我可以在不注销的情况下获得更新的 emailVerified 吗?

Ilj*_*lja 6 javascript firebase firebase-authentication

我的注册过程有以下流程:

  1. 用户填写详细信息并注册(获取发送验证电子邮件)

  2. 此用户登录后,但会看到一个要求进行电子邮件验证的屏幕

  3. 用户验证他们的电子邮件并返回应用程序

在这个阶段,如何在emailVerified不注销用户的情况下获取具有字段的新用户数据?

我希望auth().onAuthStateChanged一旦emailVerified更改为 true就会被解雇,但这不会发生,我也无法在 firebase 文档中找到任何刷新功能来手动获取此数据。

我可以获得新值的唯一方法emailVerified是注销并重新登录,但理想情况下希望避免这种情况。


更新:这是使用 JavaScript SDK

Ilj*_*lja 6

Based on android I did

firebase.auth().currentUser.reload().then(() => {
  console.log(firebase.auth().currentUser)
})
Run Code Online (Sandbox Code Playgroud)

this returns updated information about the user, I couldn't find this anywhere in the docs for some reason