Feature request: sign in providers to new popup window #9461
emulienfou
started this conversation in
Ideas
Replies: 2 comments
-
this is very much needed |
Beta Was this translation helpful? Give feedback.
0 replies
-
Since I first saw this capability with Firebase Auth many years ago, I believed it was the way to go for the best user experience. It prevents context change and loss of app state. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Goals
Background
It seems the feature as been requested from a long time now. Either in the discussions (#9410, #2880, #8267, #8891) or issues (#178, #8030).
Proposal
NextAuth v5 should provide this kind of feature for the end user.
It should provide to the user ability to choose between a single redirect (default behavior), without redirect (currently available for emails/credentials only) but also in a new window popup.
Here is a working example on how this feature could be implemented (currently working with v4.2.1):
Step 1: Override
signIn
function and typesOverride
SignInOptions
type adding newopenInNewWindow
option:We will be able to override the
signIn
function and open the new popup window:Step 2: Add open popup capability
Step 3: Handle callback
Since user has been redirected to home page after callback sign in, we need to handle the post message and close the popup. You can set this part of code in
index.tsx
file:Step 4: Use it
Beta Was this translation helpful? Give feedback.
All reactions