user3237371
user3237371

Reputation: 19

How to check web api token is valid or not in angularjs

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

Answers (1)

Mitesh Pant
Mitesh Pant

Reputation: 542

I think you wil need to look at $rootScope.$on('$stateChangeStart', function(){});

to validate your token;

Upvotes: 1

Related Questions