-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
firebase/firebase-js-sdk
#5938Description
[REQUIRED] Describe your environment
- Operating System version: MacOS Montery
- Browser version: Chrome 97.0.4692.71
- Firebase UI version: 6.0.0
- Firebase SDK version: 9.6.3
[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:
import firebase from 'firebase/compat/app'
import 'firebase/compat/auth';
import * as firebaseui from 'firebaseui'
import 'firebaseui/dist/firebaseui.css'
const firebaseConfig = {...};
const app = firebase.initializeApp(firebaseConfig);
const auth = 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);
})
const signInSuccessWithAuthResult = (authResult: any, redirectUrl?: string) => {
console.log("authResult", authResult); // Problem: authResult.user.providerData is empty! ❌
auth.signOut();
return false;
}
const ui = new firebaseui.auth.AuthUI(auth);
ui.start('#root', {
signInOptions: [
firebase.auth.EmailAuthProvider.PROVIDER_ID
],
callbacks: {
signInSuccessWithAuthResult,
},
});
When using firebase directly, it works as expected:
auth.signInWithEmailAndPassword("my-email@email.de", "password").then(credential => {
console.log("signInWithEmailAndPassword", credential); // credential.user.providerData.length === 1 ✅
return auth.signOut();
})
boldtrn and adarshmadrecha
Metadata
Metadata
Assignees
Labels
No labels