Angular Authentication made easy with Firebase
Wassim Chegham
2759

Hi, I am following the above tutorial but struggling to get the session tokens sent by both Google and Twitter. I am using the following code:

this.af.auth.login({
 provider: AuthProviders.Google,
 method: AuthMethods.Redirect
 }).then((success) => {
 console.log(‘success: ‘, success);
 this.af.database.list(‘users’).update(success.auth.uid, {
 name: success.auth.displayName,
 email: success.auth.email,
 provider: ‘google’,
 avatar: success.auth.photoURL
 });
 observer.next();
 }).catch((error) => {
 console.info(“error”, error);
 observer.error(error);
 });

which works fine with Facebook giving the following console output:

success: Object {auth: W, uid: “XXXXXXXXXXXXXXXXXXXXXXXXXXXX”, provider: 2, facebook: Lf}

however gives me a the following console output when logging in with Google or Twitter:

success: undefined

I’m sure I’m missing something pretty fundamental so any help greatly appreciated.

Cheers

George

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.