Hi, this is my source code in auth provider
login(email: string, password: string) {
this.afAuth
.auth
.signInWithEmailAndPassword(email, password)
.then((user) => {
if(user.emailVerified) {
console.log("email verified");
// Redirect the user here
} else {
// Tell the user to have a look at its mailbox
console.log("email not verified");
this.sendEmailVerification(email);
}
});
}
sendEmailVerification(email) {
this.afAuth.authState.subscribe(user => {
user.sendEmailVerification()
.then(() => {
console.log('email sent');
})
});
}
Now, I want to inform user about their email are not verified.
Maybe using toast or alert
Can you tell he how to do that because in good practice we should not import any alert or toast controller in provider file. How can i pass the message back to my LoginPage??