Course lesson

Show Protected Pages only to Authenticated Users with AngularFire Authentication Guard

User authentication has been implemented but you'll notice if you navigate to any route in the app you are free to do so whether you're logged in or not. Let's fix this.

Duration
3 min
Access
Included
Transcript
Retained from source evidence

User authentication has been implemented but you'll notice if you navigate to any route in the app you are free to do so whether you're logged in or not. Let's fix this.

@angular/fire gives us a feature that is prepared to handle protected routes: the authentication guard.

We'll add that guard to our routing module to protect our tasks page, and redirect unauthenticated users to the login page.