Currently, I have implemented Firebase Authentication in my Angular application to enable users to log in.
Here is the login()
function within my AuthService
:
login(email: string, password: string) {
return from(firebase.auth().signInWithEmailAndPassword(email, password));
}
While the login functionality is functioning as expected, I am now exploring ways to persist user data upon login to prevent inadvertent logout upon refreshing the application.
Could someone please guide me on how I can utilize the returned object from the method above to maintain a user's login session unless manually logging out of the application?