我正在尝试使用电子邮件和密码注册用户。如果注册功能有效,则会向用户的电子邮件地址发送一封邮件,该邮件必须包含用户单击以确认电子邮件地址的链接。我尝试使用AngularFireAuth.auth.currentUser.sendEmailVerification()函数来执行此操作,但它不起作用:此版本的 AngularFire/Firebase 不支持此方法。你能帮助我吗 ?
import {Injectable, NgZone} from '@angular/core';
import {AngularFireAuth} from '@angular/fire/auth';
import {first} from 'rxjs/internal/operators/first';
import * as firebase from 'firebase';
import {AngularFirestore} from '@angular/fire/firestore';
@Injectable({
providedIn: 'root'
})
export class AuthService {
public userId: string;
constructor(
private afAuth: AngularFireAuth,
private afStore: AngularFirestore,
public ngZone: NgZone
) { }
getUser(): Promise<firebase.User>{
return this.afAuth.authState.pipe(first()).toPromise();
}
loginWithEmailAndPassword(email: string, password: string): Promise<firebase.auth.UserCredential>{
return this.afAuth.signInWithEmailAndPassword(email, password);
}
async registerWithEmailAndPassword(email: string, password: string): Promise<firebase.auth.UserCredential>{
const newUserCredential: firebase.auth.UserCredential = await this.afAuth.createUserWithEmailAndPassword(email, password); …Run Code Online (Sandbox Code Playgroud) email-verification angularfire firebase-authentication angular ionic5