Serenity Vexed
Serenity Vexed•3w ago

AuthConfig not found in convex/server package (Auth0 & NextJs setup)

Hey all, I've been working on a simple project that integrates Auth0 into a NextJs & Convex app. This is not the first time of me using this setup, but I'm running into a few problems at the moment. The problems (see example code below): - Users are able to log in via Auth0, session is available etc, auth.config.ts is setup, env vars setup, providers set, but the user stays unauthenticated in convex client & server functions. (no errors, just null user in convex, in auth0 user is defined) - The AuthConfig type from convex/server in auth.config.ts ` cannot be found. Module '"convex/server"' has no exported member 'AuthConfig'`` My simple setup: https://pastebin.com/ZfjDpxX4
Pastebin
auth.config.ts```import { AuthConfig } from "convex/server";exp...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
13 Replies
Convex Bot
Convex Bot•3w ago
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!
Serenity Vexed
Serenity VexedOP•3w ago
Same is happening with WorkOS AuthKit. Just switched over. Authenitcation is working fine. But user is still null in ctx of convex function. Same for the authenticated and unauthenticated components.
No description
Serenity Vexed
Serenity VexedOP•3w ago
No description
Serenity Vexed
Serenity VexedOP•3w ago
{"type":"AuthError","error":"No auth provider found matching the given token. Check that your JWT's issuer and audience match one of your configured providers: [CustomJWT(issuer=https://api.workos.com/, app_id=client_01K8N7YBE9WD8FF5256WV7BGWD), CustomJWT(issuer=https://api.workos.com/user_management/client_01K8N7YBE9WD8FF5256WV7BGWD, app_id=client_01K8N7YBE9WD8FF5256WV7BGWD)]","baseVersion":0,"authUpdateAttempted":true} Seems to be a claims issue
erquhart
erquhart•2w ago
If you have two entries in your convex/auth.config.ts drop applicationID from the second one.
Serenity Vexed
Serenity VexedOP•2w ago
Removing the applicationId from the second entry did the trick. Thank you 🙂 Any reason on why this is the case? I followed the docs and they display the wrong configuration: https://docs.convex.dev/auth/authkit#configuring-dev-and-prod-instances (see attached screenshot) Also, do you know why the Auth0 is not working? There I had only one specification in the config (see pastebin above). It seems like the Auth0 docs are also a bit outdated. I'm sure this used to work before (cannot access my old code since its IP for companies I worked for)
No description
erquhart
erquhart•2w ago
Yeah docs are being fixed now for workos, need to look into Auth0
Serenity Vexed
Serenity VexedOP•2w ago
Awesome; if you want I can make a quick reproduction of the Auth0 app with minimal config so you guys can test it out. Let me know
erquhart
erquhart•2w ago
That'd be great!
Serenity Vexed
Serenity VexedOP•2w ago
On its way! I'll share it here in a bit
Serenity Vexed
Serenity VexedOP•2w ago
https://github.com/wouteth/convex-auth0-nextjs-demo Nextjs app pnpm dev Convex pnpm dev:convex .env.local (using my demo auth0 & convex apps) Ill share via DM since it contains secret Social login via google / github available Note: in this setup, convex websocket sync doesnt even seem to call authenticate.
GitHub
GitHub - wouteth/convex-auth0-nextjs-demo
Contribute to wouteth/convex-auth0-nextjs-demo development by creating an account on GitHub.
No description
erquhart
erquhart•2w ago
Thank you! Will get into this soon
Serenity Vexed
Serenity VexedOP•7d ago
Awesome take your time. Appreciate the help. Bump @erquhart

Did you find this page helpful?