Hi Irnel,
Use the auth service.
I did not test, but something similar to this:
export class AppComponent implements OnInit {
constructor(public afAuth: AngularFireAuth) {
}
login() {
this.afAuth.auth.signInWithPopup(new auth.GoogleAuthProvider());
}
logout() {
this.afAuth.auth.signOut();
}
ngOnInit() {
this.afAuth.auth.pipe(
filter(Boolean), // filter out non-autoheticated users
map(af => af.auth.isEmailVerified), // I'm only intersted in the verifed
part
filter(Boolean), // no logouts
tap(() => /** do what you need */)
).subscribe()
}
}
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/angular/693fe97b-f4e2-4cc2-8e05-dc801dd9178f%40googlegroups.com.