The documentation for the quick-start with Angular 2 - Section Login - contains the following errors:
localStorage.setItem('id_token', authResult.idToken);
// ...
public authenticated() {
// Check if there's an unexpired JWT
// This searches for an item in localStorage with key == 'id_token'
return tokenNotExpired();
}
This code does not work correctly with angular2-JWT, as in the latest version (see commit) the default key for token in localStorage is ‘token’, neither ‘id_token’ (as written here) nor ‘access_token’ (as in angular2-jwt previous commit).