Currently, I am working on an angular 13 project and incorporating @angular/fire 7 into my development process.
I have developed a service with various functions for injection. Below is the code snippet:
import { Injectable } from '@angular/core';
import {
Auth,
GoogleAuthProvider,
createUserWithEmailAndPassword,
signInWithEmailAndPassword,
signInWithPopup,
signOut,
FacebookAuthProvider,
} from '@angular/fire/auth';
import { LoginData } from '../../shared/interfaces';
import { map, Observable } from 'rxjs';
@Injectable({
providedIn: 'root',
})
export class AuthService {
isLoggedIn$: Observable<boolean> | undefined;
isLoggetOut$: Observable<boolean> | undefined;
constructor(private afAuth: Auth) {
}
login( email: string, password : string ) {
return signInWithEmailAndPassword(this.afAuth, email, password)
.then((data) => {
console.log(data);
})
.catch((error) => {
console.log(error);
});
}
}
While researching online, I came across a variable called authState which seems significant. However, I am unsure how to incorporate it within the context of angular/fire 7.