简体   繁体   English

电子邮件确认Firebase

[英]Email confirmation Firebase

My user can't use the application without confirming his email. 我的用户必须先确认电子邮件才能使用该应用程序。 Thus, I put him into a screen that make him wait for the email confirmation. 因此,我将他放到一个屏幕中,使他等待电子邮件确认。

The problem is that I'm not getting any feedback from the Auth Listener when the user confirm his email. 问题是,当用户确认电子邮件时,我没有收到来自Auth Listener的任何反馈。

I tried to create a pulling mechanism from the currentUser info, however it seems to me a look cache keep this information outdated. 我试图从currentUser信息中创建拉式机制,但是在我看来,外观缓存使此信息过时。

I'm using firebase javascript API. 我正在使用firebase javascript API。

registerUserListener() {
    return ConfigRepo.getInstance().FirebaseAuth.onAuthStateChanged((user) => {
      console.log('splash - registerUserListener', user);
      if (user) {
        if (user.emailVerified) {
          //It's  not called
        }
      } else {
          //It's  not called
      }
    });
  }

also doesn't work 也行不通

FirebaseApp.auth().currentUser()

I found a solution for it using the User API. 我使用用户API找到了解决方案。

reload reload() returns firebase. reload reload()返回firebase。 Promise containing void 承诺包含虚空

Refreshes the current user, if signed in. 刷新当前用户(如果已登录)。

Returns non-null firebase.Promise containing void 返回非null的Firebase.Promise包含void

It forces the user to update himself. 它迫使用户更新自己。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM