Skip to main content

TokenStorage

@authgear/react-native


@authgear/react-native / TokenStorage

Interface: TokenStorage

TokenStorage is an interface controlling when refresh tokens are stored. Normally you do not need to implement this interface. You can use one of those implementations provided by the SDK.

Methods​

delRefreshToken()​

delRefreshToken(namespace): Promise<void>

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

Parameters​

namespace​

string

Returns​

Promise<void>


getRefreshToken()​

getRefreshToken(namespace): Promise<string | null>

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

Parameters​

namespace​

string

Returns​

Promise<string | null>


setRefreshToken()​

setRefreshToken(namespace, refreshToken): Promise<void>

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

Parameters​

namespace​

string

refreshToken​

string

Returns​

Promise<void>