Session null in api/route GET but ok in POST #10703
Replies: 1 comment
-
To solve this problem you can do this: const response = await fetch(`...URL/api/posts`, {
headers: new Headers(headers()),
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello.
I'm with nextjs 14 and auth v5.
I have a test api/route.ts whos got a post and get.
await auth() return null in get request but the session on post request.
My auth.ts
my middleware:
In my server components if i attempt auth() then return too the session.
But not with my api /route GET
Call api/route in my server Component:
Sorry for my bad english
Thanks for help
Beta Was this translation helpful? Give feedback.
All reactions