Convex Auth... Authenticated works but auth.getUserId(ctx) returns null
Hi!
Quick question (hopefully) my auth cycle is working, i can use
And it's working as expected, but on the convex side i get null when i ask to the auth user.
any tips on where to start looking?
Thank you for your help!
8 Replies
is it consistently or only occasionally? there's a general auth debugging guide that can be helpful: https://docs.convex.dev/auth/debug
Debugging Authentication | Convex Developer Hub
You have followed one of our authentication guides but something is not working.
it is consistently, i'll follow the guide and report back!
(usually it's because your function is not actually inside a component that's wrapped in
Authenticated
, and so it runs too soon)Or b/c you don't have it listed as a provider in auth.config.ts - though then it wouldn't render in <Authenticated>
thanks i'll look into it now (busy day)
I have the ConvexClient (with auth) in my root layout and my auth.config.ts untouched
i'm sure i broke something, but i can't find out what :S
After long hours, It seems NextJs is not supported yet, that may be the cause?
Server-side authentication with Next.js is not supported yet. Are you using
preloadQuery
or fetchQuery
?yup, but i couldn't find how to get the token, the docs only describe clerk and auth0 😦
We're working on it, hang tight