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