有没有办法知道用户单击了验证链接? [英] Is there a way to know that a user clicked on the verification link?
问题描述
Here's the code I'm using to send a verification email (taken from the official docs)
var user = firebase.auth().currentUser;
user.sendEmailVerification().then(function() {
// Email sent.
}).catch(function(error) {
// An error happened.
});
User
对象具有emailVerified
属性.用户单击邮件中的链接时,它不会更改.它仅在重新登录时更新.
应用程序可以通过某种方式知道用户已成功验证其地址吗?
User
object has emailVerified
property. It doesn't change when user clicks the link in the mail. It only updates on re-login.
Is there a way for an app to know that a user sucessfully verified their address?
推荐答案
firebaser此处
当用户单击验证链接时,不会触发任何客户端回调.
There is no client-side callback that triggers when the user clicks the verification link.
我们已经看到一个功能请求,当用户验证其电子邮件地址时会触发云功能",但没有关于是否/何时发送更新. (另请参见: Firebase的云功能-对电子邮件的操作已验证)
We've seen a feature request to trigger Cloud Functions when a user verifies their email address, but no updates on whether/when that will come. (Also see: Cloud Functions for Firebase - action on email verified)
我现在能想到的最好的方法是致电 User.reload()
偶尔获取更新的属性.
The best I can think of now is to call User.reload()
occasionally to get the updated properties.
这篇关于有没有办法知道用户单击了验证链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!