convex auth.getUserIdentity() is inconsistent
In my
nextjs
app, I have upgraded convex-dev/auth
to the latest version 0.0.71
. I went through the documentation and correctly setup authentication including properly setting up the middleware. (also I use email provider with resend
).
Now in my app, after login, I navigate to route /partners
. This route accesses the session user (in the backend) by calling contex.auth.getUserIdentity()
. This first call works fine as it returns the logged in user object.
But when I navigate to the subroute /partners/[id]
and makes the same call, this time it returns an empty. If I go back to the previous screen and refresh the page, I'm able to get the user object just fine.
Any idea what this behaviour?...2 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
I am facing a similar issue but with getUserId which I imported as follows: import { getAuthUserId } from "@convex-dev/auth/server"; Even though user logs in successfully, still when calling this getUserId function, I get Not Found Error from the Convex backend logs.