Discord oauth 2 error

Hey there, I have a working website that uses discord oauth authentication using next-auth.js and the sign in button redirects it to localhost even though I have changed the redirect uri and nextauth url to match my new domain name. Could anyone suggest a solution for this
12 Replies
13eck
13eck2y ago
Discord OAuth won’t redirect to a URI that’s not in your dev portal nor in your code. Are you 100% sure you changed the URI?
SneaX
SneaX2y ago
Yes
SneaX
SneaX2y ago
Though now for some reason when I try to sign in, via this; "domain.com/api/auth/signin?csrf=true" it just keeps coming to this url
SneaX
SneaX2y ago
after a bit more inspection, i found this
SneaX
SneaX2y ago
@cvanilla13eck could you help the website needs to go live urgently, its for a school event
13eck
13eck2y ago
I don’t know next-auth sorry
Jochem
Jochem2y ago
looks like you still need to change that URL honestly
SneaX
SneaX2y ago
but I have changed it in my env variables hold up maybe theyre being weird on my vercel deployment I am using create t3 app and it does make the variables more complicated afaik
Jochem
Jochem2y ago
is that a page on your hosting, or on the discord side? I know oauth has a step where you're on their site and they redirect you back, not 100% sure what that looks like right now
SneaX
SneaX2y ago
my hosting the expected behavior would be that on clicking the sign in with discord button, it takes you to the discord page that asks you to authorize the sign in
Jochem
Jochem2y ago
If it's something you're hosting, it's some setting. Did you hardcode that value maybe?
SneaX
SneaX2y ago
nope oh well ill look around on stack overflow thank you for your help
Want results from more Discord servers?
Add your server