mirror of
https://github.com/NoeFabris/opencode-antigravity-auth.git
synced 2026-05-13 23:53:18 +00:00
PR Fixes
This commit is contained in:
@@ -571,11 +571,12 @@ async function promptAccountIndexForVerification(
|
||||
continue;
|
||||
}
|
||||
const normalizedIndex = parsedIndex - 1;
|
||||
if (normalizedIndex < 0 || normalizedIndex >= accounts.length) {
|
||||
const selected = accounts.find((account) => account.index === normalizedIndex);
|
||||
if (!selected) {
|
||||
console.log("Please enter a number from the list above.");
|
||||
continue;
|
||||
}
|
||||
return normalizedIndex;
|
||||
return selected.index;
|
||||
}
|
||||
} finally {
|
||||
rl.close();
|
||||
@@ -601,15 +602,15 @@ function markStoredAccountVerificationRequired(
|
||||
verifyUrl?: string,
|
||||
): boolean {
|
||||
let changed = false;
|
||||
const wasVerificationRequired = account.verificationRequired === true;
|
||||
|
||||
if (account.verificationRequired !== true) {
|
||||
if (!wasVerificationRequired) {
|
||||
account.verificationRequired = true;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
const timestamp = Date.now();
|
||||
if (account.verificationRequiredAt !== timestamp) {
|
||||
account.verificationRequiredAt = timestamp;
|
||||
if (!wasVerificationRequired || account.verificationRequiredAt === undefined) {
|
||||
account.verificationRequiredAt = Date.now();
|
||||
changed = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,10 @@ function truncateAnsi(input: string, maxVisibleChars: number): string {
|
||||
kept += 1;
|
||||
}
|
||||
|
||||
if (out.includes('\x1b[')) {
|
||||
return `${out}${ANSI.reset}${suffix}`;
|
||||
}
|
||||
|
||||
return out + suffix;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user