fix: preserve desktop session across restarts
This commit is contained in:
@@ -19,6 +19,7 @@ export interface CreateApiClientOptions {
|
||||
baseURL?: string
|
||||
timeoutMs?: number
|
||||
auth?: AuthBindings
|
||||
clearTokensOnUnauthorized?: boolean
|
||||
}
|
||||
|
||||
export class ApiClientError extends Error {
|
||||
@@ -154,7 +155,9 @@ export function createApiClient(options: CreateApiClientOptions = {}): ApiClient
|
||||
}
|
||||
}
|
||||
|
||||
auth.clearTokens()
|
||||
if (options.clearTokensOnUnauthorized !== false) {
|
||||
auth.clearTokens()
|
||||
}
|
||||
throw markHandled(normalizeError(error))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user