Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/lib/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ export async function refreshAccessToken(apiUrl?: string): Promise<string> {
saveCredentials(updated);
return data.access_token;
} catch {
// Token refresh failed — try re-authenticating interactively
if (process.stdout.isTTY) {
clack.log.warn('Session expired. Please log in again.');
const newCreds = await performOAuthLogin(apiUrl);
return newCreds.access_token;
}
throw new AuthError('Failed to refresh token. Run `insforge login` again.');
}
}
Loading