Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Feathers authentication storage type error #1969

Copy link
Copy link
@Kwiddershoven

Description

@Kwiddershoven
Issue body actions

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

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.