@authgear/capacitor / 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
Defined in
packages/authgear-capacitor/index.d.ts:958
Methods
delRefreshToken
▸ delRefreshToken(namespace): Promise<void>
Deletes the refresh token for the specified namespace in the storage.
Parameters
| Name | Type |
|---|---|
namespace | string |
Returns
Promise<void>
Implementation of
Defined in
packages/authgear-capacitor/index.d.ts:961
getRefreshToken
▸ getRefreshToken(namespace): Promise<null | string>
Retrieves the refresh token associated with a specific namespace in the storage.
Parameters
| Name | Type |
|---|---|
namespace | string |
Returns
Promise<null | string>
Implementation of
Defined in
packages/authgear-capacitor/index.d.ts:960
setRefreshToken
▸ setRefreshToken(namespace, refreshToken): Promise<void>
Stores a refresh token for a give namespace to the storage.
Parameters
| Name | Type |
|---|---|
namespace | string |
refreshToken | string |
Returns
Promise<void>
Implementation of
Defined in
packages/authgear-capacitor/index.d.ts:959