Authentication Persistence
Understand how to implement authentication persistence in Angular using Firebase. Learn how to track logged-in users across page refreshes by leveraging Firebase tokens and Angular observables. This lesson helps you create a service to manage user authentication status application-wide for consistent user state.
We'll cover the following...
At the moment, we’re able to create a new account and login. We’re going to tie up some loose ends and add some finishing touches. There are a couple of problems with the current implementation.
The biggest issue is not being able to keep track of the user who’s logged in. We also need to ensure that the user will still be logged in if the page gets refreshed. Otherwise, they’ll be forced to login when they’re already authenticated into the system.
Understanding authentication
Luckily, Firebase already keeps track of this information for us. In an earlier lesson, I advised you to clear the storage if you wanted to test the registration form multiple times. This is because Firebase ...