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
13eck14mo 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
SneaX14mo ago
Yes
SneaX
SneaX14mo 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
SneaX14mo ago
after a bit more inspection, i found this
SneaX
SneaX14mo ago
@cvanilla13eck could you help the website needs to go live urgently, its for a school event
13eck
13eck14mo ago
I don’t know next-auth sorry
Jochem
Jochem14mo ago
looks like you still need to change that URL honestly
SneaX
SneaX14mo 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
Jochem14mo 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
SneaX14mo 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
Jochem14mo ago
If it's something you're hosting, it's some setting. Did you hardcode that value maybe?
SneaX
SneaX14mo ago
nope oh well ill look around on stack overflow thank you for your help