Firebase-Admin when updating user's email user gets logout if page is refreshed

风格不统一 提交于 2021-02-17 06:44:05

问题


When updating user's email using admin.auth().updateUser({email: newEmail}) the user's email gets updated (as an authentication provider). But whenever I refresh the page, the user gets logout.

Is there a way I can prevent that from happening and keeping the user logged in after its email gets updated?


回答1:


Firebase treats the email address as its primary way of finding the account for a user when you don't (yet) have their UID. For that reason the email address is considered sensitive information, and changing it requires that the user reauthenticates before they can continue to use the app.

The Admin SDK documentation doesn't explicitly mention this as far as I can see, but you sort'of derive it from the documentation on setting a user's email address.



来源:https://stackoverflow.com/questions/65835551/firebase-admin-when-updating-users-email-user-gets-logout-if-page-is-refreshed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!