Set isEmailVerified of already verified firebase Users to false

前提是你 提交于 2019-12-11 08:37:48

问题


Every year i want my Firebase users to verify their account-email again, to check that their Email address are still in use.

To test this i sent a new verification email to my (already verified) account. The mail was sent, but this did not set my .isEmailVerified to false, also after reloading the currentUser and the app.

Does anyone know if it´s possible to set the .isEmailVerified to false, once it is true at all, and if so how to do it?


回答1:


Sending a verification email does not set the emailVerified property to false. That is the expected and intended behavior.

If you want to set the emailVerified property of a user to false, you can do so with the Firebase Admin SDK. For example, in Node.js it would be:

admin.auth().updateUser(uid, {
  emailVerified: false
})

For more examples (including in other languages) see the Firebase documentation on updating a user profile.

Note that the Admin SDK has full administrative access to your Firebase project, so should only be run from a trusted environment, such as your development machine, a server you control, or Cloud Functions for Firebase. In no instance should you try to put this functionality in the app you give to your uses, as doing so will give them administrative access to your Firebase project.



来源:https://stackoverflow.com/questions/51573021/set-isemailverified-of-already-verified-firebase-users-to-false

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