Firebase身份验证/不允许的操作

时间:2019-04-01 14:02:05

标签: javascript firebase firebase-authentication

这是一个有角度的网络应用程序。

添加了权限页面的屏幕截图

我正在尝试使用Firebase对移动设备进行身份验证。

在我的Firebase控制台>身份验证>登录方法中,我已启用电话并保存了它。

但是当我尝试登录时,它抛出一个错误,说 auth/operation-not-allowed

sendLoginCode() {
    const appVerifier = this.windowRef.recaptchaVerifier;
    const num = this.firstFormGroup.value.mobileNo
    console.log('num',num);
    firebase.auth().signInWithPhoneNumber(num, appVerifier)
      .then(result => {
             this.windowRef.confirmationResult = result;
        })
      .catch(error => console.log(error));
}
verifyLoginCode() {
    this.windowRef.confirmationResult
      .confirm(this.verificationCode)
      .then(result => {

        this.user = result.user;
        console.log('Login Successfull')

      })
      .catch(error => console.log(error, "Incorrect code entered?"));
  }

https://i.stack.imgur.com/jITY5.png

0 个答案:

没有答案