next.js server => api
Hi,
I’m working on a smaller project with some friends for planning our board game events.
I’m in the middle of doing some auth when connecting my next.js server component with my next.js api, and I’m unable to use getKindeServerSession to get a valid session?
The request when doing the original fetch is authenticated.
What do you need to know to show me the way? 👀
9 Replies
Hi @VeryGingerBear Are you using the Next.js SDK? If so what version?
Hi,
I'm using the Next.js SDK,
"@kinde-oss/kinde-auth-nextjs": "^2.3.6"
I'm using App Router.
I am doing a fetch
request from my server component, which is able to get the authenticated user.
In the API route that this fetch call goes to I do not get a user.
I haven't found documentation on how the fetch request should be structured, if the Bearer token should be passed explicitly or not etc.Hi @VeryGingerBear just wondering if you tried Sam's recommendations, and if it worked?
I tried adding debug, other than that I think the code above is pretty close?
Sorry, which code? Are you still not getting the user?
Two messages above? Can’t you see that message?
Hey @VeryGingerBear very sorry I have let this thread go stale. I'm hoping you have solved the issue. If not please let me know where things are at and I'll revive efforts to resolve.
Switched to Clerk and solved the issue in a total of 10 minutes. Switch included.
Happy for you. Best of luck.