import { Injectable } from '@angular/core' ; import { Observable } from 'rxjs' ; import { AngularFireAuth } from '@angular/fire/auth' ; import firebase from 'firebase/app' ; @ Injectable ( { providedIn : 'root' } ) export class AuthenticationService { private user : Observable < firebase . User > ; constructor ( private afAuth ) { this . user = afAuth . authState ; } resetPassword ( email ) { return this . afAuth . sendPasswordResetEmail ( email ) ; } authUser ( ) { return this . user ; } login ( email , senha ) { return this . afAuth . signInWithEmailAndPassword ( email , senha ) ; } logout ( ) { return this . afAuth . signOut ( ) ; } }