Reputation: 393
I have this error :
Property 'sendEmailVerification' does not exist on type 'Promise<User>'.ts(2339)
my code :
// Send email verfificaiton when new user sign up
SendVerificationMail() {
return this.afAuth.currentUser.sendEmailVerification()
.then(() => {
this.router.navigate(['verify-email-address']);
})
}
I don't know the origin of the error and what am I missing?
Upvotes: 1
Views: 916
Reputation: 598728
You'll need to wait until the promise resolves:
SendVerificationMail() {
return this.afAuth.currentUser.then((user) => {
return user.sendEmailVerification();
}).then(() => {
this.router.navigate(['verify-email-address']);
})
}
Upvotes: 3