Directus: JS SDK Auth localForage problem

Created on 9 Dec 2020  Â·  4Comments  Â·  Source: directus/directus

After perform login with SDK.auth.login method, it does login properly and show the login activity in the Admin App as well, however no item can be find in Local Forage.

Setup is
new DirectusSDK('URL', { storage: localforage, mode: 'json' })

Using V9RC21 js sdk

Question

All 4 comments

Currently storage is only used for storing directus_refresh_token in json mode. There is no caching in sdk

Plus that setup is nested under auth:

new DirectusSDK('URL', { auth: { storage: localforage, mode: 'json' }})

Plus that setup is nested under auth:

new DirectusSDK('URL', { auth: { storage: localforage, mode: 'json' }})

Thanks!! Working now, Should also fix the document code sample.
It currently written as.
const directus = new DirectusSDK('https://api.example.com', { storage: localforage });
https://docs.directus.io/reference/sdk-js.html#installation

Thanks @altezza04 — example updated!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jonesus picture Jonesus  Â·  3Comments

dimitrov-adrian picture dimitrov-adrian  Â·  3Comments

avanwieringen-sensus picture avanwieringen-sensus  Â·  3Comments

adamkobor picture adamkobor  Â·  3Comments

asitemade4u picture asitemade4u  Â·  3Comments