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
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!
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?here are some relevant docs: https://labs.convex.dev/auth/config/oauth/github#fill-out-the-form-with-your-app-details
GitHub - Convex Auth
Authentication library for your Convex backend
http://localhost:3001. I have OpenWebUI/Ollama_3.3) running on 3000
ahhhh, let me try that. missed that entirely.
Yep, that fixed github. Thank you. Now to figure out Magic Link not logging in after clicking link in email.
cool, glad that helped w/ GitHub - those docs are brand new, so not surprised you missed them
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
(i think they pushed yesterday, iirc)
yeah, let me backup configs and start from scratch
👍
Thanks, I'll post results here
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
i still think it works, just docs not quite complete. I feel im missing a step that devs take for granted, second nature?
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@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,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.
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.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.
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
auth.config is stock (from repo)
and first image shows JWT & parts?
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
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.
Even though i had cleared the auth tables, and app storage/cookies and restarted app (npm run dev)
anyhoo, JWT
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
np, I'm doing other things until we have this
Ok, here is the valid info:
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.
ok comparing JWTs this is the same as mine
your convex logs (dashboard) the same too?
looks like yeah
But, ours logs you in and is working. It just no likey me?
What's your error now, the
or the old one?
clear your app storage and cookies. that means you ran the auth on another localhost app
thats what i did earlier
oh yeah I didn't get this error, just copying it from above
yeah that was my fault. real error is
cool
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.
one difference is you're running this on localhost:3001
but everything is pointing to the fact that i am authenticated
could you kill your localhost:3000 and try on localhost:3000?
yeah, i have OpenWeb UI /Ollama-llama_3.3 running on 3000
maybe that assumption is baked in somewhere? like the on GitHub, what domain didyou put?
fair point, let me see about swaping that out
Same
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
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.
oh man, that's rough
is what it is. Its new Tech. Really Good tech. Worth some pain in the arse
Yeah let's do a call in 15, maybe watching your steps or comparing we'll notice a difference.
ok, 1815 CST. What app, here?
i have a Discord server myself we could use
Sure thing
I can send a zoom link too
whatever, discord is good
Send my email in Private message to you for zoom
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