v1.7.0-beta.1
Pre-release
Pre-release
Added
- Ability to use either an in-memory cache (the default) or localstorage to store tokens - stevehobbsdev - #303
- Added support for rotating refresh tokens - stevehobbsdev - #315
New cache location options
By default, auth0-spa-js will store tokens in memory. We have now added a second option, allowing you to store tokens in local storage. This has the benefit of being able to persist tokens across page refreshes.
The storage strategy can be configured using the option cacheLocation
when invoking createAuth0Client
:
const auth0 = await createAuth0Client({
domain: '<your Auth0 domain>',
client_id: '<your Auth0 client ID>',
cacheLocation: 'localstorage'
});
The cacheLocation
option can be set to one of two values: memory
, or localstorage
.
Note: Please be aware that configuring the SDK to store tokens in local storage could leave your tokens vulnerable in the event of an XSS attack.