Promise resolving to refresh success status
// Refresh the token before making an important API call
const refreshSucceeded = await refreshAccessToken();
if (refreshSucceeded) {
// Token is fresh, proceed with API call
const result = await performCriticalOperation();
} else {
// Refresh failed, re-authenticate
showLoginPrompt("Your session has expired. Please log in again.");
}
Renews the access token using the refresh token
Uses the stored refresh token to obtain a new access token when the current one expires. Dynamically imports the token refresh module to avoid circular dependencies.
This function: