DISCORD OAUTH Problem
OAUTH2, Discord
Anyone ever run into this error? https://gist.github.com/barrybtw/8bb94fdcdbbee3d1a24e0e4c2c2f8fea
I can run it locally just fine, but whenever I deploy it, I get this error in my logs...?
Somehow????
https://reactiflux-com.fly.dev/api/auth/callback/discord Redirects to localhost 3000 wtf
I've searched the whole codebase for any references to localhost:3000 but no luck, so fucking confused lol
Where's this shit coming from
Solution:Jump to solution
Figured it out, next takes in NEXTAUTH_URL as environment, defaults to localhost:3000
5 Replies
Like why would it redirect me to localhost
Code https://github.com/barrybtw/reactiflux.com
Auth config https://github.com/barrybtw/reactiflux.com/blob/main/src/auth.ts
I've restarted my server twice
Do you have your .env correctly configured?
Solution
Figured it out, next takes in NEXTAUTH_URL as environment, defaults to localhost:3000