Skip to main content

@authgear/react-native / PersistentTokenStorage

Class: PersistentTokenStorage

PersistentTokenStorage stores the refresh token in a persistent storage. When the app launches again next time, the refresh token is loaded from the persistent storage. The user is considered authenticated as long as the refresh token is found. However, the validity of the refresh token is not guaranteed. You must call fetchUserInfo to ensure the refresh token is still valid.

Implements

Table of contents

Constructors

Methods

Constructors

constructor

new PersistentTokenStorage(): PersistentTokenStorage

Returns

PersistentTokenStorage

Defined in

packages/authgear-react-native/index.d.ts:768

Methods

delRefreshToken

delRefreshToken(namespace): Promise<void>

Deletes the refresh token for the specified namespace in the storage.

Parameters

NameType
namespacestring

Returns

Promise<void>

Implementation of

TokenStorage.delRefreshToken

Defined in

packages/authgear-react-native/index.d.ts:771


getRefreshToken

getRefreshToken(namespace): Promise<null | string>

Retrieves the refresh token associated with a specific namespace in the storage.

Parameters

NameType
namespacestring

Returns

Promise<null | string>

Implementation of

TokenStorage.getRefreshToken

Defined in

packages/authgear-react-native/index.d.ts:770


setRefreshToken

setRefreshToken(namespace, refreshToken): Promise<void>

Stores a refresh token for a give namespace to the storage.

Parameters

NameType
namespacestring
refreshTokenstring

Returns

Promise<void>

Implementation of

TokenStorage.setRefreshToken

Defined in

packages/authgear-react-native/index.d.ts:769