带有电子邮件的角度谷歌身份验证,是否必须在我们登录之前进行验证?

时间:2021-02-03 14:40:54

标签: angular

我试图在我的项目 angular 和 google auth 登录中使用电子邮件和密码进行身份验证功能,我的情况是新用户在验证帐户之前无法登录到他们的帐户。我希望任何用户都可以登录到他们的帐户如果他们不验证他们的帐户..

这是我的代码,新用户在验证其帐户之前无法登录。 如果他们验证帐户,他们可以登录。我希望任何新用户都可以无需验证即可登录。

SignIn(email, password) {
    
    return this.afAuth.signInWithEmailAndPassword(email, password)

      .then((result) => {
        if (result.user.emailVerified) {

          console.log('email already verified');
          // Redirect the user here

        } else {
  

          alert('email not verified');



        }
        this.ngZone.run(() => {
          location.reload();
        });

       // this.SetUserData(result.user);
      }).catch((error) => {
        window.alert(error.message);
      });
  }

0 个答案:

没有答案