angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

Auth observable not emitting a value

Open mosh-hamedani opened this issue 10 years ago • 4 comments

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?

mosh-hamedani avatar Sep 08 '16 23:09 mosh-hamedani

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

ryanlangton avatar Sep 10 '16 02:09 ryanlangton

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

ryanlangton avatar Sep 10 '16 13:09 ryanlangton

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));

ryanlangton avatar Sep 10 '16 14:09 ryanlangton

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.

jongood01 avatar Sep 14 '16 02:09 jongood01