更改Firebase电子邮件不会更新providerData [英] Changing Firebase email doesn't update providerData

查看:123
本文介绍了更改Firebase电子邮件不会更新providerData的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在iOS应用中使用了Firebase。用户使用Firebase的电子邮件和密码身份验证进行登录。目前,我正在创建允许用户更改他们的电子邮件和密码的功能。



我注意到,使用成功更改电子邮件地址后, 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆