Angularfire: Auth observable not emitting a value

Created on 9 Sep 2016  路  4Comments  路  Source: angular/angularfire

Hi,

I'm trying to log into Firebase using OAuthToken. Here's my code:

 let creds = firebase.auth.FacebookAuthProvider.credential(response.authResponse.accessToken)

    this.af.auth.login(creds, { 
      method: AuthMethods.OAuthToken,
      provider: AuthProviders.Facebook
    })
      .then((success) => {
        console.log("Firebase success: " + JSON.stringify(success));
      })

I can confirm that get the "success" message. But, af.auth is not emitting a new value.

I didn't have this issue when logging in using the Redirect method. It happens only when using OAuthToken.

Is there something I'm doing wrong here?

Most helpful comment

Same issue after upgrading to RC7 (seemed okay for me in RC6). I'm using email / password login method and the login works but auth.subscribe never gets called.

All 4 comments

I'm having the same problem (I think) when using Popup method. I'm not sure how Redirect is suppose to work, but that's not working for me either.

http://stackoverflow.com/questions/39420716/angularfire2-authentication-with-canactivate-not-working

I switched to use auth.getAuth(). It seems this is the only way to get this to work for now until RC6 support is added.
https://github.com/angular/angularfire2/issues/493

By removing this line in firebase_sdk_auth_backend.ts, I am able to get the auth to emit. Seems maybe something to do with the zone versioning in RC6?

.observeOn(new ZoneScheduler(Zone.current));

Same issue after upgrading to RC7 (seemed okay for me in RC6). I'm using email / password login method and the login works but auth.subscribe never gets called.

Was this page helpful?
0 / 5 - 0 ratings