E404 Document using localStorage shim in certain private browsers · Issue #1344 · feathersjs/feathers · GitHub
[go: up one dir, main page]

Skip to content

Document using localStorage shim in certain private browsers #1344

@petermikitsh

Description

@petermikitsh

The getStorage implementation needs to be augmented to supported private browsers on Safari OS X, Safari iOS, and Android browsers.

Users typically supply their own storage implementation:

import authentication from 'feathers-authentication/client'
import feathers from 'feathers/client'

var client = feathers()
        .configure(authentication({storage: window.localStorage}));

window.localStorage is defined on these browsers, so it will be returned, rather than the shim. Consequently, any calls to setItem (e.g., https://github.com/feathersjs/feathers-authentication/blob/fca25f2b5b03b773975595ae9ac034199df5127b/src/client/index.js#L40-L42) will throw exceptions in these browsers.

More info in this comment on #132.

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

      0