Hey there, I've been working on my ionic4 app and have encountered an issue with the sendEmailVerification function. The console is suggesting that I may have forgotten to use 'await'. Any ideas on how to resolve this? Thank you.
import { Injectable } from '@angular/core';
import { AngularFireAuth } from '@angular/fire/auth';
@Injectable({
providedIn: 'root'
})
export class FirebaseAuthService {
constructor(private angularFireAuth: AngularFireAuth) { }
async registerWithEmailPassword(email, password) {
try {
const result = await this.angularFireAuth.createUserWithEmailAndPassword(email, password);
await this.angularFireAuth.currentUser.sendEmailVerification();
return result;
}catch (error) {
throw new Error(error);
}
}
}