How do you make fetch call from Nextjs to Hono with auth ?
I am not sure if this is the right way to fetch with auth , did not find any docs related to this , normal fetch call i did not how to pass the auth.
With this i am getting data:unknown and a 401 error.

Solution:Jump to solution
When you have an entirely seperate Nextjs frontend and Hono backend , to make an authenticated request
```ts
const res = await fetch("http://localhost:5000/api/profile", {
credentials: "include",...
4 Replies
Solution
When you have an entirely seperate Nextjs frontend and Hono backend , to make an authenticated request
Also you should not use the
nextCookies()
plugin from auth.ts config file for some reasonThis is when you have a seperate Nextjs frontend and standalone hono server. I dont think for those you replace or route all the api request from Nextjs through hono will face this issue
The reason to not use the plugin is beacuse you have separated instance which is not nextjs. its a separate concern. The cookies will be automatically parsed if you have done the integrations in the docs correctly.
@sebastian you are right , this is my setup , that is why the plugin is not useful to this kind of setup.

