更改Firebase电子邮件不会更新providerData [英] Changing Firebase email doesn't update providerData
问题描述
我注意到,使用成功更改电子邮件地址后, changedEmailForUser
,则不会更新 authData.providerData
中的电子邮件地址。要更新它,用户必须注销并再次登录(使用新的电子邮件地址)。
这是预期的行为吗?我可以手动更新providerData字典中的电子邮件(或者这是一个坏主意吗?)或者是否可以强制刷新登录用户的providerData?
这确实是预期的行为。现有会话绑定到旧的电子邮件地址。要获得新电子邮件地址的会话,用户必须再次登录。
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?
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.
这篇关于更改Firebase电子邮件不会更新providerData的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!