I am trying to retrieve the email address from Google OAuth using AngularFire, but the popup is not requesting permission for the email.
This code snippet is from the Firebase Google authentication documentation
var ref = new Firebase("https://<your-firebase>.firebaseio.com");
ref.authWithOAuthPopup("google", function(error, authData) { /* Your Code */ }, {
scope: "email"
});
While this works in my Angular application, I'm looking for a way to modify my angular code to achieve the same result.
var ref = new Firebase("https://<your-firebase>.firebaseio.com");
var auth = $firebaseAuth(ref);
auth.$authWithOAuthPopup("google").then(function(authData) {
/* Implement your logic here */
}).catch(function(error) {
console.error("Authentication failed:", error);
});
You can refer to this link for a similar issue with an answer, although it didn't provide a clear solution on how to fix it.