feat(auth): extend refresh TTL and keep session on transient errors
Bumps refresh token lifetime to 720h with env overrides, and stops clearing the local session for non-401 refresh failures so users aren't logged out by transient network blips. Adds a 60s retry timer when a refresh fails for non-auth reasons. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -133,8 +133,11 @@ export function createApiClient(options: CreateApiClientOptions = {}): ApiClient
|
||||
`Bearer ${nextTokens.accessToken}`;
|
||||
return client.request(originalRequest);
|
||||
} catch (refreshError) {
|
||||
auth.clearTokens();
|
||||
throw normalizeError(refreshError);
|
||||
const normalizedRefreshError = normalizeError(refreshError);
|
||||
if (normalizedRefreshError.status === 401) {
|
||||
auth.clearTokens();
|
||||
}
|
||||
throw normalizedRefreshError;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user