Provider invalid OAuth2 redirect_uri
I am getting an error when I try to sign in with Discord on my prod environment. I don't have this issue locally
I get
Invalid OAuth2 redirect_uri
and I checked the browser logs
The redirect uri is the backend where better-auth is set up https://mercury-development.up.railway.app/api/auth/callback/discord
the request cookie has the __secure
prefix
I think my oauth2 redirect uri is set up correctly, it's basically the same for local and prod as well
4 Replies
I also noticed regular sign-in just stuck loading so not sure if that also plays part in this

but registration works, my user was created in the DB
I think that it might have something to do with your clientIDs
client_id=1344915763433308160
redirect_uri=https://mercury-development.up.railway.app/api/auth/callback/discord
But I cant see that redirect_uri in your oauth panel for that specified ID.
yeah good catch i did not notice that. My backend env var change didn't go through