getSession() is null after login?
I'm currently trying to get the user in a client component however:
returns
All of my other widgets that use the server client is able to get user no problem but for some reason session must not be persisted locally?
When users login from /login it's from a server component.
8 Replies
Can you verify a session exists in the browser? Would be a cookie if you're using auth helpers.
@j4
I have a cookie for auth (localhost):
Interesting. What version of auth helpers?
What's the code you're using to create that client component?
Ok, so there's your issue. If you're going to use auth helpers, you need to use their methods of clients or creating clients. By using the native
createClient()
function, that defaults to looking at browser localStorage for storage; whereas the auth helpers use cookies for storage.Ok im dumb i should've obviously used:
and its corresponding auth methods 🥹