You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My scenario is that I used an external OAuth service. After the user sign in successfully, the OAuth will redirect to my API route with user information (NEXT.js API route) Then I want to create a session using the information returned from OAuth.
So, is there a way to create a session directly from backend code without signing in from the frontend? (The OAuth service I used has their own sign in page).
I have search in the document and found that I may have to setup a custom provider. But, to be honest, it is quite scary for me to do all the configs 😢. So if there's a way to get around that, it will be good.
I also tried to use the signIn function which imported from "next-auth/react" and, obviously, it is not working. Because this signIn is intended to be used only on the frontend (It involves the window object on browser)
The text was updated successfully, but these errors were encountered:
@ChayaninSuatap I think your question is similar to what i asked here #6086
A lot of backends handle the oauth themselves. The problem is handling the refresh tokens and access tokens in both client and server.
Question 💬
My scenario is that I used an external OAuth service. After the user sign in successfully, the OAuth will redirect to my API route with user information (NEXT.js API route) Then I want to create a session using the information returned from OAuth.
So, is there a way to create a session directly from backend code without signing in from the frontend? (The OAuth service I used has their own sign in page).
I have search in the document and found that I may have to setup a custom provider. But, to be honest, it is quite scary for me to do all the configs 😢. So if there's a way to get around that, it will be good.
I also tried to use the signIn function which imported from "next-auth/react" and, obviously, it is not working. Because this signIn is intended to be used only on the frontend (It involves the window object on browser)
The text was updated successfully, but these errors were encountered: