#Cannot get current user

1 messages · Page 1 of 1 (latest)

torpid pollen
#

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.

#

My getUserIdentity somehow doesn't work, it returns null for this

wild arch
#

What’s your getCurrentUser look like?

torpid pollen
delicate tinsel
#

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 that

You have followed one of our authentication guides but something is not working.

torpid pollen
#

Is it correct when I wrap the ConvexProviderWithClerk around with Clerk Provider ?

torpid pollen
#

I am able to fix it . Thanks