Cannot get current user
I try to retrieve the data from current User to start to create a post, but I cannot retrieve the data somehow.
I did the authentication with Clerk but did copy the data to Convex database, somehow it still cannot see the currentUser.
7 Replies
My getUserIdentity somehow doesn't work, it returns null for this
What’s your getCurrentUser look like?
It is in the picture on the right side
This is usually because you're calling a query outside of a
Authenticated
component so it is running before the authentication has been completely propagated (https://docs.convex.dev/auth/debug#ctxauthgetuseridentity-returns-null-in-a-query)
The interesting part here would be to see where you're calling the function that is unexpectedly returning null
in your client code + the React tree above thatDebugging Authentication | Convex Developer Hub
You have followed one of our authentication guides but something is not working.
Is it correct when I wrap the ConvexProviderWithClerk around with Clerk Provider ?
I am able to fix it . Thanks
Wanted to say a big thank you for sharing this.
I just spent almost 2 hours trying to understand why getUserIdentity was returning null and this worked like a charm!