Conclusion on Route Guard: AuthGuard
Let's upload our updated application to GitHub and conclude this chapter.
We'll cover the following
What have we done so far?
In this chapter:
- We saw how routes can be restricted to certain users using route guards that are provided by Angular.
- By adding a new
isLoggedIn
method toAuthService
we were then able to use this method within our route guard to restrict the dashboard to authorized, logged-in users. - Users who aren’t logged in are redirected elsewhere (the home page for now) preventing them from accessing portions of our app they shouldn’t be able to see.
Get hands-on with 1400+ tech skills courses.