Reputation: 19
I am working on Angularjs Authentication and I am getting tokens from web API, in routechange event I want to check the generated token is valid or not, if it is valid then i want to redirect to some other route, if the token is not valid then i want to redirect to login page.
How to check the token is valid or not
Upvotes: 0
Views: 156
Reputation: 542
I think you wil need to look at $rootScope.$on('$stateChangeStart', function(){});
to validate your token;
Upvotes: 1