Rutwick Gangurde Rutwick Gangurde - 1 month ago 12x
AngularJS Question

AngularJs - Skip login page if already logged in

I have implemented an Authentication system for my app. I use

(in run) to check if the user is logged in and redirect him to login if not. This works fine. But, I can access the login page via the url, I want to send the user to the dashboard if he's already logged in. What is the proper way to do this?



$rootScope.$on('$locationChangeStart', function(event, newUrl, oldUrl) {}); 

Details here$location