I am attempting to check if the next
has a token or not, but it is not working and I am getting an error:
TypeError: Cannot read property 'next' of undefined
Any suggestions?
app.js
.run(function ($rootScope, $location,$log,User) {
$rootScope.$on("$locationChangeStart", function (event,next, current,jwtHelper) {
if(!localStorage.token.next){
location.path("/signin");
}
});