Next.js Discord

Discord Forum

Testing OAuth2 in preview

Answered
Evanion posted this in #help-forum
Open in Discord
I'm working on adding authentication via next-auth to my app. Now, since the provider needs to send a post to the requesting party, I can't run it on localhost, and I can't test it on preview either due to the authentication layer of vercel.
My question is... is there any way, I can disable the preview environments vercel authentication, so that my auth provider can call my callback function?
Answered by Evanion
Solved it, I had registered the incorrect redirect uri in discord.
For future issues if you are using next-auth:
the URI should be: https://<yoursite>/api/auth/callback/<providerId>
and it works with localhost if you add the correct path.
View full answer

1 Reply

Solved it, I had registered the incorrect redirect uri in discord.
For future issues if you are using next-auth:
the URI should be: https://<yoursite>/api/auth/callback/<providerId>
and it works with localhost if you add the correct path.
Answer