Fix auto-refresh on 401 in base API service

This commit is contained in:
CREDO23 2026-02-05 19:29:34 +02:00
parent 1690ce1891
commit a8e8b0e2fd
2 changed files with 20 additions and 3 deletions

View file

@ -179,8 +179,9 @@ export function getAuthHeaders(additionalHeaders?: Record<string, string>): Reco
/**
* Attempts to refresh the access token using the stored refresh token.
* Returns the new access token if successful, null otherwise.
* Exported for use by API services.
*/
async function refreshAccessToken(): Promise<string | null> {
export async function refreshAccessToken(): Promise<string | null> {
// If already refreshing, wait for that request to complete
if (isRefreshing && refreshPromise) {
return refreshPromise;