How to avoid that firebaseUI Email Link authentication opens a second browser tab?
When using the Email Link Authentication method with firebaseUI-web, the emailed hyperlink opens a new browser tab in order to confirm/authenticate the email reception to firebase, and then redirects to the initial URL. This leaves the user with two browser tabs with the same (authenticated) original URL.
Is there a way to end up with only one open browser tab?
I have tried to configure the firebaseUI EmailAuthProvider with an emailLinkSignIn function returning: { url: '';}, this has no effect. {url: '[another url]';}, this opens 'another url' but then does not authenticate the user (in the original browser tab). (My idea was that I could show a confirmation and guide the user to the original tab).
I don't think there is any way to go back to the original tab.
- So accepted normal behavior is to leave the user with two identical tabs?
- Any chance to configure the mentioned URL to show 'another url', and at the same time have the initial url authenticate the user? I couldn't get it to work; maybe I need to specify URL within initial domain(?).
I agree that two open, logged in tabs is messy and confusing. Nevertheless, I love the potential of passwordless auth.
Here are my workarounds:
- You can use
if (firebase.auth().isSignInWithEmailLink(window.location.href)) {
// prompt user to return to original | close this tab | etc.
}
- When the original link is sent, I alert the user that they can close the current tab, and their session will resume where they left off when they click the email link.
Thank you for taking the time to submit this feature request
This is a great idea and definitely something we can consider for the future. It is not currently prioritized for our immediate new version roadmap, as we are focusing on a new upcoming release.
In the meantime, we will keep this issue open so we can revisit it during a later planning cycle, particularly as we gather more feedback from the community.
Hello, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. If it is still relevant, leave a comment to keep it open.
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.