Retrieve a Session from the given storage based on its session ID. If possible,
the Session is logged in before it is returned, so that session.fetch
may
access private Resources without any additional interaction.
If no storage is provided, a default in-memory storage will be used. It is instantiated once on load, and is shared across all the sessions. Since it is only available in memory, the storage is lost when the code stops running.
A Session is available in storage as soon as it logged in once, and it is removed from storage on logout.
The ID of the Session to retrieve.
Optional
options: Partial<Options to control the session loading behavior.
A Session object, potentially authenticated, or undefined if no Session in storage matches the given ID.
Retrieve a Session from the given storage based on its session ID. If possible,
the Session is logged in before it is returned, so that session.fetch
may
access private Resources without any additional interaction.
If no storage is provided, a default in-memory storage will be used. It is instantiated once on load, and is shared across all the sessions. Since it is only available in memory, the storage is lost when the code stops running.
A Session is available in storage as soon as it logged in once, and it is removed from storage on logout.
The ID of the Session to retrieve.
Optional
storage: IStorageThe storage where the Session can be found.
Optional
onNewRefreshToken: (newToken: string) => unknownA callback to call on refresh token rotation.
Optional
refresh: booleanA session object, authenticated if possible, or undefined if no Session in storage matches the given ID.
Retrieve a Session from the given storage based on its session ID. If possible, the Session is logged in before it is returned, so that
session.fetch
may access private Resources without any additional interaction.If no storage is provided, a default in-memory storage will be used. It is instantiated once on load, and is shared across all the sessions. Since it is only available in memory, the storage is lost when the code stops running.
A Session is available in storage as soon as it logged in once, and it is removed from storage on logout.
Param: sessionId
The ID of the Session to retrieve.
Param: storage
The storage where the Session can be found.
Returns
A session object, authenticated if possible, or undefined if no Session in storage matches the given ID.