# Angular quickstart incompatible with latest version of angular2-jwt

**URL:** <https://community.auth0.com/t/angular-quickstart-incompatible-with-latest-version-of-angular2-jwt/6213>\
**Category:** Get Help\
**Tags:** angular-2, angular2-jwt, quickstart\
**Created:** [April 14, 2017, 12:47am UTC](https://community.auth0.com/t/angular-quickstart-incompatible-with-latest-version-of-angular2-jwt/6213 "2017-04-14T00:47:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lettau.ralph](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@lettau.ralph](https://community.auth0.com/u/lettau.ralph)\
**Post date:** [April 14, 2017, 12:47am UTC](https://community.auth0.com/t/angular-quickstart-incompatible-with-latest-version-of-angular2-jwt/6213/1 "2017-04-14T00:47:04Z")

</div>

The documentation for the quick-start with Angular 2 - [Section Login](https://auth0.com/docs/quickstart/spa/angular2/01-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](https://github.com/auth0/angular2-jwt/commit/a6984d1df9315cc52b22b9c57b8badc4b6d1f479)) the default key for token in localStorage is ‘token’, neither ‘id\_token’ (as written here) nor ‘access\_token’ (as in angular2-jwt previous commit).

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [April 17, 2017, 10:30pm UTC](https://community.auth0.com/t/angular-quickstart-incompatible-with-latest-version-of-angular2-jwt/6213/2 "2017-04-17T22:30:58Z")

</div>

A simple fix for the quickstart would be:

```
localStorage.setItem('token', authResult.idToken);

```

* * *

The previous content was provided by @lettau.ralph in the question body itself, I’m providing it as an answer for discoverability reasons.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [April 17, 2017, 10:32pm UTC](https://community.auth0.com/t/angular-quickstart-incompatible-with-latest-version-of-angular2-jwt/6213/3 "2017-04-17T22:32:16Z")

</div>

@lettau.ralph I reported this issue internally; I also added your original workaround as an answer so that other people find it easier to locate. If you want you can add that as your own answer and I’ll later delete mine. Thanks for reporting this situation.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:53am UTC](https://community.auth0.com/t/angular-quickstart-incompatible-with-latest-version-of-angular2-jwt/6213/4 "2018-03-02T05:53:15Z")

</div>


