如何设置当前用户电子邮件验证:在浏览器中为true(替换实际的电子邮件验证)?



我想让用户在注册后输入他们将收到的代码来验证他们的电子邮件。(替换电子邮件验证( 将"电子邮件验证"当前用户的对象属性设置为 true 应该采用什么方法?

if (userCodeInput === verificationCode) {
currentUser.updateProfile({
emailVerified: true,
displayName: "name changed"
}).then(function() {
// Update successful.
}).catch(function(error) {
// An error happened.
});
}

适用于显示名称,但不适用于电子邮件已验证。

这可能可以在 admin-sdk 中完成,但不能在客户端 sdk 上完成。

https://firebase.google.com/docs/auth/admin/manage-users#update_a_user

这是有道理的,因为用户不应该有权绕过验证流程,但管理员应该。

最新更新