Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing Firebase email doesn't update providerData

Tags:

ios

firebase

I'm using Firebase in my iOS app. The user logs in using Firebase's email and password authentication. Currently, I'm creating functionality that lets the user change their email and password.

I noticed that after successfully changing the e-mail address using changingEmailForUser, the e-mail address in authData.providerData isn't updated. To update it, the user has to log out and log in again (using the new email address).

Is this expected behavior? Can I update the email in the providerData dictionary manually (or is that a bad idea?) or is it possible to force a refresh of the providerData for the logged in user?

like image 456
rodskagg Avatar asked Jun 23 '26 03:06

rodskagg


1 Answers

This is indeed expected behavior. The existing session is "bound" to the old email address. To get a session for the new email address, the user will have to sign in again.

like image 105
Frank van Puffelen Avatar answered Jun 25 '26 16:06

Frank van Puffelen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!