burnstony#1975
burnstony#19756mo ago

convex auth user info

if I am using convex auth, how do I get the user id from the backend is there something like ctx.auth I was using ctx.auth.getUserIdentity and using tokenIdentifier, but it makes more sense to use user id but I am unsure the correct pattern to get that info
2 Replies
ian
ian6mo ago
Check out https://labs.convex.dev/auth/authz#use-authentication-state-in-backend-functions specifically I think you want auth.getUserId()
Authorization - Convex Auth
Authentication library for your Convex backend
burnstony#1975
burnstony#1975OP6mo ago
Thank you

Did you find this page helpful?