NlaakALD
NlaakALD2w ago

Are we sure this is working?

https://github.com/get-convex/template-nextjs-convexauth-shadcn I've cloned, gone through the config steps and provided Resend, Github. For magic-link, After clicking link in email it opens sign in page in separate tab and not logged it. For Github, it complains: Be careful! The redirect_uri is not associated with this application. The application might be misconfigured or could be trying to redirect you to a website you weren't expecting. I am of course running localhost. So I went through steps again. I am missing something or something missing from docs?
GitHub
GitHub - get-convex/template-nextjs-convexauth-shadcn: Convex + Nex...
Convex + Next.js + Convex Auth. Contribute to get-convex/template-nextjs-convexauth-shadcn development by creating an account on GitHub.
51 Replies
Convex Bot
Convex Bot2w 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!
dowski
dowski2w ago
hi, i just did a fresh clone of the repo and went through the npm install and npm run dev steps and was able to get GitHub and Resend to log me in so i think it's generally working did you use your convex deployment URL as your GitHub callback URL or is that using localhost?
dowski
dowski2w ago
GitHub - Convex Auth
Authentication library for your Convex backend
NlaakALD
NlaakALDOP2w ago
http://localhost:3001. I have OpenWebUI/Ollama_3.3) running on 3000
Edit this page
Configuration
OAuth
GitHub
GitHub
Instructions
Follow these instructions to configure Convex Auth to use GitHub OAuth in a development environment.

Open the Github OAuth app registration form
You can navigate directly to the form or expand for detailed manual steps.

Fill out the form with your app details
You can name your app whatever you like, but note that the name and description will be presented to users when they attempt to login with GitHub for your application.

For the Homepage URL, use http://localhost:5173 (or whatever local address your development server uses).

For the Authorization callback URL, first find the HTTP Actions URL for your Convex deployment. You can find that in the Convex dashboard under Settings -> URL & Deploy Key -> Show development credentials.

Your HTTP Actions URL will match your Deployment URL, except it will end in .site instead of .cloud.
Edit this page
Configuration
OAuth
GitHub
GitHub
Instructions
Follow these instructions to configure Convex Auth to use GitHub OAuth in a development environment.

Open the Github OAuth app registration form
You can navigate directly to the form or expand for detailed manual steps.

Fill out the form with your app details
You can name your app whatever you like, but note that the name and description will be presented to users when they attempt to login with GitHub for your application.

For the Homepage URL, use http://localhost:5173 (or whatever local address your development server uses).

For the Authorization callback URL, first find the HTTP Actions URL for your Convex deployment. You can find that in the Convex dashboard under Settings -> URL & Deploy Key -> Show development credentials.

Your HTTP Actions URL will match your Deployment URL, except it will end in .site instead of .cloud.
ahhhh, let me try that. missed that entirely.
NlaakALD
NlaakALDOP2w ago
Yep, that fixed github. Thank you. Now to figure out Magic Link not logging in after clicking link in email.
No description
dowski
dowski2w ago
cool, glad that helped w/ GitHub - those docs are brand new, so not surprised you missed them
NlaakALD
NlaakALDOP2w ago
hmmm, maybe magic Link is working. After Authorizing Github. I get email about it and it send me to Signin page (not signed in). Im going to wipe and start over. Something wrong with the this particular code in repo
dowski
dowski2w ago
(i think they pushed yesterday, iirc)
NlaakALD
NlaakALDOP2w ago
yeah, let me backup configs and start from scratch
dowski
dowski2w ago
👍
NlaakALD
NlaakALDOP2w ago
Thanks, I'll post results here
NlaakALD
NlaakALDOP2w ago
hmm, So i have done it twice now. (Github) that is. Its authorizing me i see the user on github but gets further but app (messages) still saying cant verify token. Authorization callback URL = Set as per docs https://stan***-****-573.convex.site/api/auth/callback/github ENV's set. Repo was created with npm create convex@latest -- -t nextjs-convexauth-shadcn as suggested in README.md @ https://github.com/get-convex/template-nextjs-convexauth-shadcn
No description
No description
NlaakALD
NlaakALDOP2w ago
i still think it works, just docs not quite complete. I feel im missing a step that devs take for granted, second nature?
dowski
dowski2w ago
interesting - i wonder if maybe there are some stale cookies for localhost from a prior setup attempt? can you look in your browser's dev tools and see if that's the case? i can definitely trigger some errors in the same code location with stale cookies, but haven't repro'ed the exact one you're seeing
NlaakALD
NlaakALDOP2w ago
@dowski I cleared convex DB tabls, and cleared all coockies, locals storage, etc. Even tried making new project again with different keys, convex url. same thing. its got to be something minor. something you do without thinking but is not documented for some of use. "Convex-Auth for Dummies" @dowski I am not sure. I it also is not creating the Keys or setting initial convex env vars. i have to do that manual. stop the npm run dev and manually do it. I have to manually add Resend to package manager as well. If you want, we can schedule a time and i will screen share and we can go through a fresh install to maybe determine what the issues is. Hopefully helps the project out,
NlaakALD
NlaakALDOP2w ago
this is so annoying. Everything shows its working. But a call into the node_modules package has a issue. im not even sure where it is. OAuth/Refresh working fines. Convex logs show that. I modified page.tsx and users.ts (viewer) for more verbose info. but it never makes it into api.users.viewer. seems to be failing at viewer = await fetchQuery(..) level.
An error occurred: {"code":"Unauthenticated","message":"Could not verify token claim"}
An error occurred: {"code":"Unauthenticated","message":"Could not verify token claim"}
1. Unauthenticated? not according to the logs and data saved in convex tables 2. "Could not verify token claim". Why? what is wrong? again, backend shows sunshine and roses. ConvexHttpClient.query (webpack-internal)? Error message is horrible. Tells you absolutely nothing.
ballingt
ballingt2w ago
Can you post what your JWT looks like? There are instructions on finding it in https://docs.convex.dev/auth/debug#step-2-check-whether-authentication-works-on-the-frontend
Debugging Authentication | Convex Developer Hub
You have followed one of our authentication guides but something is not working.
ballingt
ballingt2w ago
or you could DM, parts of it are potentially sensitive if this isn't a test acount also would be good to know what your auth.config.ts looks like, that's something that needs to match
NlaakALD
NlaakALDOP2w ago
auth.config is stock (from repo) and first image shows JWT & parts?
ballingt
ballingt2w ago
Point taken on the error being better, this is the code that throws this https://github.com/get-convex/convex/blob/6ee47e6bb9415f25b8d8aa6cee101824257550a7/crates/keybroker/src/broker.rs#L410, we may be able to show more info without introducing security issues. Could you DM me the entire JWT? Or go to https://jwt.io/ and screenshot that output first image shows part of it, but to decode it we need the whole thing
NlaakALD
NlaakALDOP2w ago
anything you guys need hmmm thats wierd. i jump over to my GWF project and was working on that. i just reopened and ran thsi test repo again and error changed.
An error occurred: {"code":"NoAuthProvider","message":"No auth provider found matching the given token"}
An error occurred: {"code":"NoAuthProvider","message":"No auth provider found matching the given token"}
Even though i had cleared the auth t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BfA-sRB7WsgtckkSKTYxfko6HbOXsTR26PJz99uFqpfyKUXPPc6KM3K1k6WNGU9qqKthZ7AvZc-RjcwWnr1PetFP-EZBqY5Hjm6yE7vHMZL7zRTvbL_53bdLAyzRcOXNRKAVhi3yDu9DC_5p3CohgibTlPcCBIx0QC4g
not worried about security. its a test app on localhost., its ok ok crap. nevermind ignore that JWT. Corrupt. the localhost has my other app in it. i need to clear and refresh. sorry. give me a min
ballingt
ballingt2w ago
np, I'm doing other things until we have this
NlaakALD
NlaakALDOP2w ago
Ok, here is the valid info:
eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJqeDczeTFlYnpoZnphbWhodmVnZHIzMm1wOTc2OXJwcXxqaDcxamo0cjBhdmRwNzkwbW50MjAzdHpjNTc2YXNxdCIsImlhdCI6MTczNDA0NDk5MiwiaXNzIjoiaHR0cHM6Ly9wcmVjaW91cy1jbGFtLTEwLmNvbnZleC5zaXRlIiwiYXVkIjoiY29udmV4IiwiZXhwIjoxNzM0MDQ4NTkyfQ.Eq0iCXw-J9P8amwX8cY8v-wlKdhDA2uEUBIlR4Dw-qpeyejiLf_vdqievJynPL-RCe7RKZNU0-FAM3P73e8F9AuiowZwgnaF5l6WgyZ2i55DFThkbk3879fnjYJhqAh1I-2Ytz6CYr2NWb_mnmrdeJPiX33v9LNlauMzUXR_KzVEg9HJb7-t0f8a66c83wWuLb8L7RQb_cQ5gZhOLtkJl1FV9imO-fgHJg3NqzZH5w0XFmevE5-kKV6iMm6udOlrZXRQvWYrUlpn3QM0HtczQYPUgpczBqqxBwgEVZTRU8W5kJcR7Rh8AhS608mOsEbJQ7DAOS9Msp-oPLDJEvK9Ag
eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJqeDczeTFlYnpoZnphbWhodmVnZHIzMm1wOTc2OXJwcXxqaDcxamo0cjBhdmRwNzkwbW50MjAzdHpjNTc2YXNxdCIsImlhdCI6MTczNDA0NDk5MiwiaXNzIjoiaHR0cHM6Ly9wcmVjaW91cy1jbGFtLTEwLmNvbnZleC5zaXRlIiwiYXVkIjoiY29udmV4IiwiZXhwIjoxNzM0MDQ4NTkyfQ.Eq0iCXw-J9P8amwX8cY8v-wlKdhDA2uEUBIlR4Dw-qpeyejiLf_vdqievJynPL-RCe7RKZNU0-FAM3P73e8F9AuiowZwgnaF5l6WgyZ2i55DFThkbk3879fnjYJhqAh1I-2Ytz6CYr2NWb_mnmrdeJPiX33v9LNlauMzUXR_KzVEg9HJb7-t0f8a66c83wWuLb8L7RQb_cQ5gZhOLtkJl1FV9imO-fgHJg3NqzZH5w0XFmevE5-kKV6iMm6udOlrZXRQvWYrUlpn3QM0HtczQYPUgpczBqqxBwgEVZTRU8W5kJcR7Rh8AhS608mOsEbJQ7DAOS9Msp-oPLDJEvK9Ag
No description
NlaakALD
NlaakALDOP2w ago
Is that what you needed? Let me know whatever you need. If you need a screenshare to snoop at the whole project (99% from the repo), setup/settings - its fine with me as I stated, its local and just a test bed.
ballingt
ballingt2w ago
ok comparing JWTs this is the same as mine
NlaakALD
NlaakALDOP2w ago
your convex logs (dashboard) the same too?
No description
ballingt
ballingt2w ago
looks like yeah
No description
NlaakALD
NlaakALDOP2w ago
But, ours logs you in and is working. It just no likey me?
ballingt
ballingt2w ago
What's your error now, the
An error occurred: {"code":"NoAuthProvider","message":"No auth provider found matching the given token"}
An error occurred: {"code":"NoAuthProvider","message":"No auth provider found matching the given token"}
or the old one?
NlaakALD
NlaakALDOP2w ago
clear your app storage and cookies. that means you ran the auth on another localhost app thats what i did earlier
ballingt
ballingt2w ago
oh yeah I didn't get this error, just copying it from above
NlaakALD
NlaakALDOP2w ago
yeah that was my fault. real error is
An error occurred: {"code":"Unauthenticated","message":"Could not verify token claim"}
An error occurred: {"code":"Unauthenticated","message":"Could not verify token claim"}
ballingt
ballingt2w ago
cool
NlaakALD
NlaakALDOP2w ago
If i clear all data stored on localhost app, wipe all convex auth related tables. and try to login with github it works until that error.
ballingt
ballingt2w ago
one difference is you're running this on localhost:3001
NlaakALD
NlaakALDOP2w ago
but everything is pointing to the fact that i am authenticated
ballingt
ballingt2w ago
could you kill your localhost:3000 and try on localhost:3000?
NlaakALD
NlaakALDOP2w ago
yeah, i have OpenWeb UI /Ollama-llama_3.3 running on 3000
ballingt
ballingt2w ago
maybe that assumption is baked in somewhere? like the on GitHub, what domain didyou put?
NlaakALD
NlaakALDOP2w ago
fair point, let me see about swaping that out
NlaakALD
NlaakALDOP2w ago
No description
NlaakALD
NlaakALDOP2w ago
Same
ballingt
ballingt2w ago
shoot, sorry this is so frustrating! I'm not sure what could be different here I'd be up for a call where we both walk through the steps to make sure something isn't different
NlaakALD
NlaakALDOP2w ago
your call. I could do a call in about 15 min? We clear everything out in backend and browser and got one step at a time. my main Project gwf.io is actually broke now, for last 2 months as i was converting it from Clerk to Convex-Auth. It was not officially released so it was still on dev no prod. Thats how long i have been trying to get Convex-Auth to work. I love convex, I know its new and maybe i was to quick to jump in. But i figured sooner would be easier.
ballingt
ballingt2w ago
oh man, that's rough
NlaakALD
NlaakALDOP2w ago
is what it is. Its new Tech. Really Good tech. Worth some pain in the arse
ballingt
ballingt2w ago
Yeah let's do a call in 15, maybe watching your steps or comparing we'll notice a difference.
NlaakALD
NlaakALDOP2w ago
ok, 1815 CST. What app, here? i have a Discord server myself we could use
ballingt
ballingt2w ago
Sure thing I can send a zoom link too whatever, discord is good
NlaakALD
NlaakALDOP2w ago
Send my email in Private message to you for zoom
ballingt
ballingt2w ago
We looked together and I'm going to start with making fixes to the setup script, which isn't doing anything as you mention here

Did you find this page helpful?