I've set up "Sign in with Apple" using Firebase Web SDK as described on this guide: https://firebase.google.com/docs/auth/web/apple
I'm getting everything returned correctly from the SDK except for user.displayName returning null.
This is an excerpt of the code I'm using:
var provider = new firebase.auth.OAuthProvider('apple.com');
provider.addScope('email');
provider.addScope('name');
firebase.auth()
.signInWithPopup(provider)
.then((result) => {
console.log(result.user); // displays user.displayName = null
});
I know that Apple only returns name information on first authentication with the same app, unless you go to your Apple security settings / "sign in with apple" and cancel the association with that app.
Important clue: I can see from the network logs that google is correctly returning firstName, lastName and displayName to my web app, so the problem is on the Firebase web SDK not returning it to me.
I've googled everything, but no I've found no solution except for using a different library.
Anyone faced and solved this issue?
Notes:
- I've already successfully set up a similar "Sign in with Google" using the same Firebase Web SDK: https://firebase.google.com/docs/auth/web/google-signin
- I'm using Firebase compat library v10.7.2 as described here: https://firebase.google.com/docs/web/modular-upgrade#window-compat