angular / router

The Angular 1 Component Router
MIT License
665 stars 135 forks source link

Component Lifecycle Hooks #384

Closed PhilipAdservice closed 8 years ago

PhilipAdservice commented 8 years ago

Hi I'm having problems using the lifecycle hooks. I'm trying to check if the user is logged in before each route. Does anyone have a good example of a lifecycle hook which checks if a user is logged in and if not redirects the user to "/login". I'm storing a login token in a cookie which i use to check if the user is logged in or not.