How can I redirect to the login page if someone tries to hit any other route when they are not authenticated? Is there a \"best\" way to do this in AngularJS?
Seems
I am doing this a different way now, with Node.js & Express & the That was probably not the best solution, but I didn't want to use third-party modules. If you get confused or have any questions (I know I was pretty confused) just ask.passport module, but before that, when I was using PHP, I did it with several Angular modules. I had an outside module on my tag with ng-app, then ng-controllers at certain tags, like & certain ng-controllers, I had an authentication function, then I had an ng-if for login, logout, etc. If the user is not logged in, I hid the current page and ng-included the appropriate page. Otherwise, I ng-included the current page.