'ERROR FirebaseError: Error (auth/argument-error) Firebase V9 Angular
I'm trying to implement logging in with mobile number.
Below is my code,
In Login Component HTML
<a class="btn btn-default btn-lg shadow-sm" (click)="authService.SignInwithMobileNumber(mobileNo.value)">Sign In</a>
In Auth Service.ts
SignInwithMobileNumber(phoneNumber) {
this.reCaptchaVerifier = new RecaptchaVerifier('recaptcha-container', {
'size':'invisible',
'callback': (response:any) => {},
'expired-callback': () => {}
}, this.auth)
console.log(this.reCaptchaVerifier);
return this.afAuth
.signInWithPhoneNumber(phoneNumber, this.reCaptchaVerifier)
.then((confirmationResult) => {
localStorage.setItem(
'verificationId',
JSON.stringify(confirmationResult.verificationId)
);
this.ngZone.run(() => {
this.router.navigate(['/verify']);
});
})
.catch((error) => {
console.log(error.message);
alert(error.message);
});
}
Below is the error, I'm getting while trying to login
ERROR FirebaseError: Firebase: Error (auth/argument-error)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
