nextspace
    Preparing search index...

    Function refreshAccessToken

    • Attempts to refresh the access token using the refresh token. Updates both in-memory tokens (via TokenManager) and the session cookie.

      Concurrent callers are automatically deduplicated: if a refresh is already in progress every additional caller awaits the same promise rather than issuing a second request that would invalidate the first one.

      Cross-tab coordination is handled by TokenManager via BroadcastChannel: if another tab already refreshed the token, this will detect the updated cookie and adopt the new tokens without making a redundant network call.

      Returns Promise<boolean>

      True if refresh was successful, false otherwise.