I want to get the email address from Google OAuth using AngularFire, but on popup, it's not asking for the email permission.
This is the code from Firebase Google auth doc
var ref = new Firebase("https://<your-firebase>.firebaseio.com");
ref.authWithOAuthPopup("google", function(error, authData) { /* Your Code */ }, {
scope: "email"
});
It works in my angular application, but how can I fix my angular code to do the same?
var ref = new Firebase("https://<your-firebase>.firebaseio.com");
var auth = $firebaseAuth(ref);
auth.$authWithOAuthPopup("google").then(function(authData) {
/* Code */
}).catch(function(error) {
console.error("Authentication failed:", error);
});
Link to the same problem with answer, but I don't get the answer and how to fix it.
authData.google.emailcontains the Google user's primary email address as listed on their profile. Returned only if a valid email address is available, and the Google email permission was granted by the user. - Kato