Firebase v3 GoogleAuthProvider not saving email -
(1) question:
is there way read user email having uid? (permitted super user or server)
ps.: don't want save in realtime database, because though current user can change it, can erase or put fake email..
(2) problem:
i'm trying retrieve user email googleauthprovider in firebase v3
thats code i'm using:
signinwithgoogle(): promise<any> { let provider = new firebase.auth.googleauthprovider(); provider.addscope("https://www.googleapis.com/auth/userinfo.email"); return firebase.auth().signinwithpopup(provider) .then((result) => { console.log(result.user.email); console.log(result.credential); let token = result.credential.accesstoken; return this.createorupdateuser(result.user, token); }); }
the result:
result.user.email # null result.user.providerdata[0].email # correct_email@gmail.com
though email in providerdata, not attached auth.. firebase bug or can fix somehow?
thanks!
the 3.2.0 web sdk launched yesterday should automatically ask profile scope when signinwithpopup google provider. try deleting test user , sign in again. top level email should populated.
Comments
Post a Comment