Angular code is executed client side only, so any state will disappear once you reload the page.
If you want to keep information between two user session, you have many options:
- Keep that info in the URL using
$locationorlocation - Store that info in
localStorageand retrieve it next time - Persist the information server side and query your server to get it back
Follow-up:
Once you get your token you can do:
localStorage.setItem('myToken', $rootScope.jwtToken);
And when you load your application, check if a token has been stored:
$rootScope.jwtToken = localStorage.getItem('myToken');