Class

LocalStorageStore

LocalStorageStore()

Constructor

# new LocalStorageStore()

Session store that persists data in the browser's localStorage.

localStorage is not available in Safari when running in private mode. In general it is better to use the AdaptiveStore that automatically falls back to the CookieStore when localStorage is not available.

This session store does not work with FastBoot. In order to use Ember Simple Auth with FastBoot, configure the CookieStore as the application's session store.

View Source session-stores/local-storage.js, line 9

Extends

Members

String

# static key

The localStorage key the store persists data in.

Properties:
Name Type Description
key
Default Value:
  • 'ember_simple_auth-session'

View Source session-stores/local-storage.js, line 37

Methods

# static clear() → {Ember.RSVP.Promise}

Clears the store by deleting the LocalStorageStore.key from localStorage.

View Source session-stores/local-storage.js, line 86

A promise that resolves when the store has been cleared successfully and rejects otherwise.

Ember.RSVP.Promise

# static persist(data) → {Ember.RSVP.Promise}

Persists the data in the localStorage.

Parameters:
Name Type Description
data Object

The data to persist

View Source session-stores/local-storage.js, line 55

A promise that resolves when the data has successfully been persisted and rejects otherwise.

Ember.RSVP.Promise

# static restore() → {Ember.RSVP.Promise}

Returns all data currently stored in the localStorage as a plain object.

View Source session-stores/local-storage.js, line 72

A promise that resolves with the data currently persisted in the store when the data has been restored successfully and rejects otherwise.

Ember.RSVP.Promise