Angular2-jwt: localStorage to sessionStorage

Created on 13 Apr 2017  ·  9Comments  ·  Source: auth0/angular2-jwt

hi i want to change the localStorage to sessionStorage
how ?

stale

Most helpful comment

@escardin if you are using the helpers some are always using localStorage and not the tokenGetter (see for example for tokenNotExpired ). But you can still pass directly the token to the helper.

All 9 comments

@OdaiTu Using sessionStorage is mentioned in the readme, https://github.com/auth0/angular2-jwt#advanced-configuration.

@rrjohnson85 when i create the auth.module.ts file and inject the auth in my servicse the application stopping working how to provide it ?

and i have this stange issue when i refresh the tab the token get invalid !

In my opinion sessionStorage doesn't work, I have exactly same configuration as in the readme and it doesn't work, angular2-jwt ignore such configuration

Please post your configs.

@escardin if you are using the helpers some are always using localStorage and not the tokenGetter (see for example for tokenNotExpired ). But you can still pass directly the token to the helper.

@255kb wow, good one, maybe this is my problem

@255kb yes, if you are using tokenNotExpired you need to fetch the token yourself and pass it as the second argument.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇‍♂️

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fabiodomingues picture fabiodomingues  ·  5Comments

jaumard picture jaumard  ·  5Comments

UlyssesAlves picture UlyssesAlves  ·  5Comments

leosvelperez picture leosvelperez  ·  5Comments

wannabegeek picture wannabegeek  ·  3Comments