I am blind.. HALP! (oauth redirect config issue)
Hey gang, I know I am blind, but I just can't see what the problem is...
just set up this toy app
https://cha-chess.vercel.app/
(it's going to be an online chess thing with websocket)
and I can't log in!
localhost works, production doesn't, I get the "Invalid Oauth2 redirect_uri" error...
what am I missing?!?!?!
Create T3 App
Generated by create-t3-app
20 Replies
are you setting the correct env value for prod?
I think so ðŸ˜
I think it's only the first part
Without the /api/...
I have it like this in another project and it works there, but lemme try anyways
on the "Invalid Oauth2 redirect_uri"
plus I think this should match what you put into discord
can you paste the redirect url?
it's there in the post
not that
?
when you click to sign in with discord
there is a new page
with the error
that URL?
yea
sure, 1 sec
https://discord.com/oauth2/authorize?client_id=1055105361364926484&scope=identify%20email&response_type=code&redirect_uri=https%3A%2F%2Fcha-chess.vercel.app%2Fapi%2Fauth%2Fcallback%2Fapi%2Fauth%2Fcallback%2Fdiscord%2Fapi%2Fauth%2Fdiscord%2Fcallback%2Fdiscord&state=jYOH2sO1iihDcscp7qfZiTJICSVZ-w1F0qpJm_rbkbU
this is the one with the error
and this is the sign-in https://cha-chess.vercel.app/api/auth/signin?callbackUrl=https%3A%2F%2Fcha-chess.vercel.app%2F
yep
you duplicated the code
oh damn!
you're right!
should be only the domain
without the /api/...
redirect_uri=https%3A%2F%2Fcha-chess.vercel.app%2Fapi%2Fauth%2Fcallback%2Fapi%2Fauth%2Fcallback%2Fdiscord%2Fapi%2Fauth%2Fdiscord%2Fcallback%2Fdiscord
there's 2 of them here
thank you, my eagle eyed friedn! 😄yes
.
oauth2 is annoying
gl
okay cool, redeployed without the
/api/...
and it works 🖖