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
Since updating to firebaseui 6.0.0, after signing up or signing in the currentUser.providerData is empty. This problem did not occur in v4 and v5.
Relevant Code:
providerData is empty when using firebaseui for signIn:
importfirebasefrom'firebase/compat/app'import'firebase/compat/auth';import*asfirebaseuifrom'firebaseui'import'firebaseui/dist/firebaseui.css'constfirebaseConfig={...};constapp=firebase.initializeApp(firebaseConfig);constauth=firebase.auth(app);auth.onAuthStateChanged(user=>{// Problem: authResult.user.providerData is empty after signin with firebaseui, ❌// but has one element when using auth.signInWithEmailAndPassword() directly ✅console.log("user signed in",user);})constsignInSuccessWithAuthResult=(authResult: any,redirectUrl?: string)=>{console.log("authResult",authResult);// Problem: authResult.user.providerData is empty! ❌auth.signOut();returnfalse;}constui=newfirebaseui.auth.AuthUI(auth);ui.start('#root',{signInOptions: [firebase.auth.EmailAuthProvider.PROVIDER_ID],callbacks: {
signInSuccessWithAuthResult,},});
When using firebase directly, it works as expected:
if (fbUser.providerData && fbUser.providerData.length === 0) {
console.debug('User data is not fully loaded, initiate reload');
fbUser.reload().then(() => // update your UI here...);
}
Thanks for the report folks; the linked PR will fix the issue. You'll need to update your version of the Firebase JS SDK (i.e. not Firebase UI) to benefit from the fix once the PR is merged/released
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
Since updating to firebaseui 6.0.0, after signing up or signing in the
currentUser.providerData
is empty. This problem did not occur in v4 and v5.Relevant Code:
providerData
is empty when using firebaseui for signIn:When using firebase directly, it works as expected:
The text was updated successfully, but these errors were encountered: