-
-
Notifications
You must be signed in to change notification settings - Fork 796
Description
I've recently been updating a project with an old version of Feathers to the latest version. I ran into a problem with the setup of the authentication-client with sessionStorage. Simply using storage: window.sessionStorage (or window.localStorage for that matter!) resulted in a type error:
Type 'Storage' is not assignable to type 'import("c:/---/node_modules/@feathersjs/authentication-client/lib/storage").Storage'.
The types returned by 'getItem(...)' are incompatible between these types.
Type 'string | null' is not assignable to type 'Promise'.
Type 'null' is not assignable to type 'Promise'.
The "workaround" I'm using now is:
import { StorageWrapper } from "@feathersjs/authentication-client/lib/storage";
and then
storage: new StorageWrapper(window.sessionStorage)
Which works, but StorageWrapper isn't an exported member (only Storage and MemoryStorage).
The current docs don't seem to have an example and I haven't seen anyone else with the issue, so I'm left wondering what I'm missing and how this is supposed to be done?
System configuration
Module versions
"@feathersjs/authentication-client": 4.5.4
"@feathersjs/feathers": 4.5.3
NodeJS version:
12.16.1
Operating System:
Win 10 pro
Module Loader:
"webpack": 3.6.0
"vue-loader": 13.3.0
"babel-loader": 8.1.0