Configure: prioritize Keep existing auth option

This commit is contained in:
Benjamin Jesuiter
2026-02-17 10:42:26 +01:00
parent 1c00fbca36
commit 874ec049cb
2 changed files with 2 additions and 1 deletions

View File

@@ -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:");

View File

@@ -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" },
];