export function authDataToAuthState(authData: firebase.User, providerData?: OAuthCredential): FirebaseAuthState {
if (!authData) return null;
let providerId;
let { uid } = authData;
let authState: FirebaseAuthState = { auth: authData, uid, provider: null };
if (authData.isAnonymous) {
providerId = 'anonymous';
authState.provider = AuthProviders.Anonymous;
authState.anonymous = true;
return authState;
} else {
providerId = authData.providerData[0].providerId;
}
When the custom token is submitted to Firebase at one point we end up here. From what I noticed, the authData.providerData is an array of length 0 and hence
providerId = authData.providerData[0].providerId;
results in undefined error.
I do not know where the fix should be -
a) Should Firebase return providerData & providerId set to "custom" as expected by AngularFire2 ?
or
b) Should AngularFire2 determines that authentication used was custom so there will be no providerData ?
Regards
Kapil
When the custom token is submitted to Firebase at one point we end up here. From what I noticed, the authData.providerData is an array of length 0 and hence
providerId = authData.providerData[0].providerId;results in undefined error.
I do not know where the fix should be -
a) Should Firebase return providerData & providerId set to "custom" as expected by AngularFire2 ?
or
b) Should AngularFire2 determines that authentication used was custom so there will be no providerData ?
Regards
Kapil