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
FacebookAuthProvider.credentialFromError returns null when trying to link anonymous user with an external provider, after moving to modular version of SDK.
The same applies to GoogleAuthProvider
Relevant Code:
The code with the previous version of SDK is working fine:
constprovider=newFacebookAuthProvider();provider.setCustomParameters({display: 'popup',});constfirebaseUser=firebaseApp.auth().currentUser;if(firebaseUser&&firebaseUser.isAnonymous){try{constresult=awaitfirebaseUser.linkWithPopup(provider);returnmapFirebaseResponseToUser(result.user!);}catch(error){if(isCredentialAlreadyInUseError(error)){awaitfirebaseUser.delete();constresult=awaitfirebaseApp.auth().signInWithCredential(error.credential// <------ The credential here is correct);returnmapFirebaseResponseToUser(result.user!);}throwerror;}}
The code using Alpha SDK, null error credential:
constprovider=newFacebookAuthProvider();provider.setCustomParameters({display: 'popup',});constfirebaseUser=getAuth(firebaseApp).currentUser;if(firebaseUser&&firebaseUser.isAnonymous){try{constresult=awaitlinkWithPopup(firebaseUser,provider,browserPopupRedirectResolver);returnmapFirebaseResponseToUser(result.user!);}catch(error){if(isCredentialAlreadyInUseError(error)){constcredential=FacebookAuthProvider.credentialFromError(error); <!-- the credential here is null
awaitfirebaseUser.delete();constresult=awaitsignInWithCredential(getAuth(firebaseApp),credential!);returnmapFirebaseResponseToUser(result.user!);}throwerror;}}
The text was updated successfully, but these errors were encountered:
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
Steps to reproduce:
FacebookAuthProvider.credentialFromError returns null when trying to link anonymous user with an external provider, after moving to modular version of SDK.
The same applies to GoogleAuthProvider
Relevant Code:
The code with the previous version of SDK is working fine:
The code using Alpha SDK, null error credential:
The text was updated successfully, but these errors were encountered: