I'm trying the new FirebaseUI for Web (https://github.com/firebase/FirebaseUI-Web). But when I tried to login with Email, it redirects me to an AccountChooser website.
Is there anyway that I can turn off that AccountChooser?
Thanks
I'm trying the new FirebaseUI for Web (https://github.com/firebase/FirebaseUI-Web). But when I tried to login with Email, it redirects me to an AccountChooser website.
Is there anyway that I can turn off that AccountChooser?
Thanks
You can disable by adding an entry into the variable uiConfig
in Firebase. You have to add this in the uiConfig variable:
'credentialHelper': firebaseui.auth.CredentialHelper.NONE
Here is an example of it inside uiConfig
:
var uiConfig = {
callbacks: {
signInSuccess: function (currentUser, credential, redirectUrl) {
return true;
},
uiShown: function () {
document.getElementById('loader').style.display = 'none';
}
},
//Start it here
credentialHelper: firebaseui.auth.CredentialHelper.NONE,
//End it here
signInFlow: 'popup',
signInSuccessUrl: '<url-to-redirect-to-on-success>',
signInOptions: [
// Leave the lines as is for the providers you want to offer your users.
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
firebase.auth.FacebookAuthProvider.PROVIDER_ID,
firebase.auth.TwitterAuthProvider.PROVIDER_ID,
firebase.auth.EmailAuthProvider.PROVIDER_ID
],
// Terms of service url.
tosUrl: '<your-tos-url>'
};
var ui = new firebaseui.auth.AuthUI(firebase.auth());
ui.start('#firebaseui-auth-container', uiConfig);
If anyone isn't bringing in firebaseui (e.g. if you're using react-firebaseui), it could be helpful know thatfirebaseui.auth.CredentialHelper.NONE === 'none'
This answer was provided in this SO question: Disable account chooser FirebaseUI React Credit to @RafikTighilt and @JeffBergman
I am using /__/firebase/init.js
and no explicit initialization and getting
firebaseui not initialized on ,'credentialHelper': firebaseui.auth.CredentialHelper.NONE
Solution, change the order of the statements:
var ui = new ...
var uiConfig = { ...
ui.start('#firebaseui-auth-container', uiConfig);
Found a fix for this here:
https://github.com/firebase/firebaseui-web/issues/42
Download the firebase-ui-auth.js
file (you can copy version 0.5
from here). You need to change one character and host the file yourself instead of using the CDN.
In the file, look for: "accountChooserEnabled",!0
and change the !0
to !1
.
This did the trick for me!
© 2022 - 2024 — McMap. All rights reserved.