1

I am using Apple sign in to login users to my app and then authenticate on firebase. Now sometimes users do not share their email in which case Apple provides a fictious email. After sign in am storing the emails in a database by verifying them first with firebase. I update the fictious email with a real one first on firebase and then send verification email. After updating the primary email on firebase, can the user loggin again with Apple given that Apple will still provide the old fictious email.

FirebaseUser firebaseUser = await FirebaseAuth.instance.currentUser();
await firebaseUser.updateEmail(email);
await firebaseUser.sendEmailVerification();

1 Answer 1

2

If you update the email of a user using "Sign in with Apple", the user will still be able to login as they normally do.

Notice that there are 2 emails on the account, one set at the provider level (eg. user.providerData[0].email) and one at the top level (user.email).

On account creation (first sign up with Apple), both emails will be set to the one provisioned by Apple. After the updateEmail operation, the top level one (user.email) will be updated but the other one (user.providerData[0].email) will remain the same.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.