auth0-blog / angular2-authentication-sample

This is a sample that shows how to add authentication to an Angular 2 (ng2) app
MIT License
965 stars 335 forks source link

Update LoggedInOutlet.ts #49

Closed MasterKale closed 8 years ago

MasterKale commented 8 years ago
MasterKale commented 8 years ago

I discovered an issue in LoggedInOutlet that allowed you to load a non-public route after loading a public route. To recreate the issue, load the /login route and then change the URL in the address bar and go to /home. The /home route will load because this.parentRouter.lastNavigationAttempt will return /login, which IS a public route.

Calling instance.urlPath will return the route that is currently being navigated to and will redirect accordingly if the route is not in publicRoutes.

ojacquemart commented 8 years ago

:+1:, I noticed the same issue.