angularfire验证功能,用于验证电子邮件是否正在使用
我知道android angularfire提供了类似firebase.auth.getinstances()的功能,它可以获取并检查任何电子邮件标识符是否与输入字段匹配,以验证电子邮件的可用性。是否有一个web应用程序的等效功能,因为我一直在寻找文档,但没有结果 这就是我到目前为止所拥有的,我想要实现的是能够在继续让用户输入密码之前验证电子邮件angularfire验证功能,用于验证电子邮件是否正在使用,angular,typescript,authentication,firebase-authentication,Angular,Typescript,Authentication,Firebase Authentication,我知道android angularfire提供了类似firebase.auth.getinstances()的功能,它可以获取并检查任何电子邮件标识符是否与输入字段匹配,以验证电子邮件的可用性。是否有一个web应用程序的等效功能,因为我一直在寻找文档,但没有结果 这就是我到目前为止所拥有的,我想要实现的是能够在继续让用户输入密码之前验证电子邮件 <form novalidate [formGroup]="SignupForm"> <div *ngIf="!regEmail
<form novalidate [formGroup]="SignupForm">
<div *ngIf="!regEmail">
<div class="form-group w-100">
<button mat-button type="button" class="btn-google" (click)="authService.GoogleAuth()">
<i class="fa fa-google"></i>
Sign up with Google
</button>
</div>
<div class="form-group w-100">
<button mat-button type="button" class="btn-facebook " (click)="authService.FacebookAuth()">
<i class="fa fa-facebook"></i>
Sign up with Facebook
</button>
</div>
<div class="divider w-100">
<span class="bg-white p-3"><span class="orInner">OR</span></span>
</div>
<mat-form-field>
<input matInput type="email" placeholder="email" formControlName="email" #userEmail>
</mat-form-field>
<!--Error codes-->
<div class="d-flex flex-column align-items-center">
<div class="form-group w-100">
<button mat-raised-button type="button" class="w-100" (click)="emailValidate( userEmail.value)">Continue
</button>
</div>
</div>
</div>
<div *ngIf="regEmail">
<mat-form-field>
<input matInput type="password" placeholder="Password" #userPwd required>
</mat-form-field>
<div class="form-group w-100">
<button mat-raised-button type="button" class="w-100"
(click)="authService.SignUp( userEmail.value, userPwd.value)">Continue
</button>
</div>
</div>
</form>
您可以使用来检查signingmethods
是否包含密码
,因此它类似于
emailValidate(email) {
return this.authService.afAuth.auth.fetchSignInMethodsForEmail(email)
.then((signInMethods)=> {
var isEmailAvailable=!signInMethods.includes('password');
if (isEmailAvailable){
this.regEmail = email;
}
else{
alert('email not available')
}
}
谢谢这句话让我困了这么久
var isEmailAvailable=!签名方法。包括(“密码”)代码>
emailValidate(email) {
return this.authService.afAuth.auth.fetchSignInMethodsForEmail(email)
.then((signInMethods)=> {
var isEmailAvailable=!signInMethods.includes('password');
if (isEmailAvailable){
this.regEmail = email;
}
else{
alert('email not available')
}
}