User Identity returns null when using useQuery
I am using nextjs for my project. When using useQuery in the client, the user identity initially returns the user object but returns null after a short while. The component keeps flickering alternating from authenticated state to non-authenticated state.
Am I doing anything wrong?
3 Replies
This is my query function.
Hey @NanaGaisie, my guess is that your issue is with your provider setup.
Follow https://docs.convex.dev/auth/debug and double check the guide you followed to set up auth.
Also:
on its own doesn't do anything, you need to call the mutation from a
useEffect
(see https://docs.convex.dev/auth/database-auth#calling-storeuser-from-react)Debugging Authentication | Convex Developer Hub
You have followed one of our authentication guides but something is not working.
Storing Users in the Convex Database | Convex Developer Hub
You might want to have a centralized place that stores information about the
going to mark this as closed. also a lot of discussion in https://discord.com/channels/1019350475847499849/1225252977699455067