Next.js Discord

Discord Forum

Implementing custom OAuth with Next Auth?

Unanswered
Egyptian Mau posted this in #help-forum
Open in Discord
Avatar
Egyptian MauOP
Hey, I need to implement an OAuth API that works the following way:

1: User logs in => I got that step covered I just put the authorization url in the provider to the URL of the API.
2: API redirects to a frontend url with a code that can be exchanged for a refresh and access token by calling another endpoint, lets call it apiurl.com/getToken?code=whatever => In part clear to me I need to receive that code on the frontend and hit that api. What is not clear to me is how I do this in my provider so that Next Auth understands what is happening?

0 Replies