diff --git a/src/commands/auth-choice-prompt.test.ts b/src/commands/auth-choice-prompt.test.ts index d393856e81..8f932c0be7 100644 --- a/src/commands/auth-choice-prompt.test.ts +++ b/src/commands/auth-choice-prompt.test.ts @@ -67,6 +67,7 @@ describe("auth choice keep existing", () => { } if (params.message === "OpenAI auth method") { const keepExisting = params.options.find((option) => option.value === "skip"); + expect(params.options[0]?.value).toBe("skip"); expect(keepExisting?.label).toBe("Keep existing"); expect(keepExisting?.hint).toContain("APIKey:"); expect(keepExisting?.hint).toContain("OAuth:"); diff --git a/src/commands/auth-choice-prompt.ts b/src/commands/auth-choice-prompt.ts index d5d008dc59..62f9c06b4d 100644 --- a/src/commands/auth-choice-prompt.ts +++ b/src/commands/auth-choice-prompt.ts @@ -115,8 +115,8 @@ export async function promptAuthChoiceGrouped(params: { ? buildKeepExistingOption({ group, store: params.store }) : undefined; const methodOptions: Array<{ value: string; label: string; hint?: string }> = [ - ...group.options, ...(keepExistingOption ? [keepExistingOption] : []), + ...group.options, { value: BACK_VALUE, label: "Back" }, ];