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
Neto
Neto•3y ago
are you setting the correct env value for prod?
robotkutya
robotkutyaOP•3y ago
I think so 😭
Neto
Neto•3y ago
I think it's only the first part Without the /api/...
robotkutya
robotkutyaOP•3y ago
I have it like this in another project and it works there, but lemme try anyways
Neto
Neto•3y ago
on the "Invalid Oauth2 redirect_uri"
robotkutya
robotkutyaOP•3y ago
plus I think this should match what you put into discord
Neto
Neto•3y ago
can you paste the redirect url?
robotkutya
robotkutyaOP•3y ago
it's there in the post
Neto
Neto•3y ago
not that
robotkutya
robotkutyaOP•3y ago
?
Neto
Neto•3y ago
when you click to sign in with discord there is a new page with the error
robotkutya
robotkutyaOP•3y ago
that URL?
Neto
Neto•3y ago
yea
robotkutya
robotkutyaOP•3y ago
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
Neto
Neto•3y ago
yep you duplicated the code
robotkutya
robotkutyaOP•3y ago
oh damn! you're right!
Neto
Neto•3y ago
should be only the domain without the /api/...
robotkutya
robotkutyaOP•3y ago
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! 😄
Neto
Neto•3y ago
yes . oauth2 is annoying gl
robotkutya
robotkutyaOP•3y ago
okay cool, redeployed without the /api/... and it works 🖖
Want results from more Discord servers?
Add your server