Why I can't get current logged in user information
When I logged in using convex auth, auth and user tables updated, but can't get current authenticated user like this way
const identity = await ctx.auth.getUserIdentity();
Also got this error
4 Replies
What does your JWT token look like, and what does your convex/auth.config.ts look like?
auth.config.ts:
const config = {
providers: [
{
domain: process.env.NEXT_PUBLIC_CONVEX_CLOUD_URL,
applicationID: 'thirdparties',
},
],
};
export default config;
When using Convex auth, the URL should end in
.convex.site
, not .convex.cloud
.
The usual configuration is
(https://labs.convex.dev/auth/setup/manual#configure-authconfigts)
Importantly, it needs to match the iss
and aud
field in the token sent to the backend in the Authenticate
message (https://docs.convex.dev/auth/debug#step-3-check-that-backend-configuration-matches-frontend-configuration)Manual Setup - Convex Auth
Authentication library for your Convex backend
Debugging Authentication | Convex Developer Hub
You have followed one of our authentication guides but something is not working.
@sshader Thank you for your reply
It's very helpful