Gets the currently stored refresh token used for obtaining
new access tokens when they expire. Dynamically imports the
token module to avoid circular dependencies.
This function:
Attempts to retrieve token from memory state first
Falls back to secure storage if not in memory
Rehydrates memory state from storage when needed
Returns null if no valid refresh token exists
Handles all retrieval errors gracefully
Returns Promise<null|string>
Promise resolving to the refresh token or null if not authenticated
Example
// Check if we have a refresh token before attempting refresh constrefreshToken = awaitgetRefreshToken(); if (refreshToken) { constsuccess = awaitrefreshAccessToken(); if (success) { console.log("Successfully refreshed access token"); } }
Retrieves the stored refresh token
Gets the currently stored refresh token used for obtaining new access tokens when they expire. Dynamically imports the token module to avoid circular dependencies.
This function: