Class

BaseStore

BaseStore()

Constructor

# new BaseStore()

The base class for all session stores. This serves as a starting point for implementing custom session stores and must not be used directly.

Session Stores persist the session's state so that it survives a page reload and is synchronized across multiple tabs or windows of the same application.

View Source session-stores/base.ts, line 6

Extends

  • Ember.Object

Methods

# abstract static clear() → {Promise}

Clears the store.

`BaseStores`'s implementation always returns a rejecting promise. __This
method must be overridden in subclasses__.

View Source session-stores/base.ts, line 64

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

Promise

# abstract static clearRedirectTarget() → {void}

Called by SessionService.clearRedirectTarget.

This method clears a `redirectTarget` from a child class' store mechanism.
Additionally can be assigned `null` to opt out of using this mechanism.

View Source session-stores/base.ts, line 113

void
Example
clearRedirectTarget = null;

    

# abstract static getRedirectTarget() → {string|null}

Called by SessionService.getRedirectTarget.

This method is retrieve a persisted `redirectTarget` from a child class' store mechanism.
Additionally can be assigned `null` to opt out of using this mechanism.

View Source session-stores/base.ts, line 97

string | null
Example
getRedirectTarget = null;

    

# abstract static restore() → {Promise}

Returns all data currently stored as a plain object.

`BaseStores`'s implementation always returns a rejecting promise. __This
method must be overridden in subclasses__.

View Source session-stores/base.ts, line 51

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

Promise

# abstract static sessionDataUpdated(data) → {Promise.<unknown>}

Triggered when the session store's data changes due to an external event, e.g., from another tab or window of the same application. The session handles that event, passes the updated data to its authenticator's BaseAuthenticator.restore method and handles the result of that invocation accordingly.

Parameters:
Name Type Description
data Object

The updated session data

View Source session-stores/base.ts, line 35

Promise.<unknown>

# abstract static setRedirectTarget(urL) → {void}

Called by SessionService.setRedirectTarget.

This method is used to persist a `redirectTarget` which is an alternative to the non-persistent SessionService.attemptedTransition.
`redirectTarget` is meant to replace SessionService.attemptedTransition that is discarded the moment a browser tab is refreshed.

This method is meant to be always implemented but can be `undefined` for backwards compatibility.
Additionally can be assigned `null` to opt out of using this mechanism.
Parameters:
Name Type Description
urL string

View Source session-stores/base.ts, line 77

void
Example
setRedirectTarget = null;