Я знаю, что android angularfire предоставляет что-то вроде firebase.auth.getinstances (), которое может извлечь и проверить, совпадает ли какой-либо идентификатор электронной почты с полем ввода для проверки доступности электронной почты. Существует ли эквивалентная функция для веб-приложения, поскольку я искал документацию безрезультатно.
Это то, что я имею до сих пор, то, чего я хочу достичь, - это иметь возможность проверить электронную почту, прежде чем перейти кпусть пользователь вводит пароль
<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>
и смутное представление о том, как мне настроить мои emailValidator
в тс
emailValidate(email) {
return this.authService.afAuth.auth.fetchSignInMethodsForEmail(email)
.then(function(signInMethods) {
//signInMethod returns ["password"] email not available
if (signInMethods /*what to i put here */)
//display verification error
console.log(signInMethods);
//signInMethod returns [] email available
if (signInMethods /*what to i put here */)
this.regEmail = email;
})
}