diff --git a/apps/frontend/src/main/claude-profile/token-refresh.ts b/apps/frontend/src/main/claude-profile/token-refresh.ts index ee31418c..f5d114b6 100644 --- a/apps/frontend/src/main/claude-profile/token-refresh.ts +++ b/apps/frontend/src/main/claude-profile/token-refresh.ts @@ -162,9 +162,13 @@ export function formatTimeRemaining(ms: number | null): string { * The new tokens must be stored immediately. * * @param refreshToken - The refresh token to use + * @param configDir - Optional config directory for the profile (used to clear cache on error) * @returns Result containing new tokens or error information */ -export async function refreshOAuthToken(refreshToken: string): Promise { +export async function refreshOAuthToken( + refreshToken: string, + configDir?: string +): Promise { const isDebug = process.env.DEBUG === 'true'; if (isDebug) { @@ -228,6 +232,11 @@ export async function refreshOAuthToken(refreshToken: string): Promise