i need a simple solution about auto-login to the app;
basically the app should start and try to go TabsPage, and if there is no auth, should go to the LoginPage. after log in, app will not log out until actual user taps logout button.
i only found that document: click
firebase.auth().setPersistence(firebase.auth.Auth.Persistence.SESSION)
.then(function() {
at there i edited this like that:
persistentLogin() {
this.afAuth.auth.setPersistence(firebase.auth.Auth.Persistence.LOCAL)
.then(function() {
// Existing and future Auth states are now persisted in the current
// session only. Closing the window would clear any existing state even
// if a user forgets to sign out.
// ...
// New sign-in will be persisted with session persistence.
return this.login();
})
.catch(function(error) {
// Handle Errors here.
});
}
but on this code i am taking an error on this ones "firebase", i tried this.afAuth.auth is not working also:
firebase.auth.Auth.Persistence.LOCAL
There is not much document about this thing on the internet, anyone knows the deal ? thanks for reading ..