diff --git a/packages/dashboard/app/components/SettingsModal.tsx b/packages/dashboard/app/components/SettingsModal.tsx index 516fbe916..026a3eb94 100644 --- a/packages/dashboard/app/components/SettingsModal.tsx +++ b/packages/dashboard/app/components/SettingsModal.tsx @@ -1026,7 +1026,7 @@ export function SettingsModal({ try { const { url, instructions, manualCode, deviceCode } = await loginProvider(providerId); - if (instructions?.trim()) { + if (instructions?.trim() && !(providerId === "github-copilot" && deviceCode)) { setLoginInstructions((prev) => ({ ...prev, [providerId]: instructions })); } if (manualCode) { diff --git a/packages/dashboard/app/components/__tests__/SettingsModal.test.tsx b/packages/dashboard/app/components/__tests__/SettingsModal.test.tsx index 7b753b119..6704f28ff 100644 --- a/packages/dashboard/app/components/__tests__/SettingsModal.test.tsx +++ b/packages/dashboard/app/components/__tests__/SettingsModal.test.tsx @@ -1643,6 +1643,7 @@ describe("SettingsModal", () => { }); mockLoginProvider.mockResolvedValueOnce({ url: "https://auth.example.com/login", + instructions: "Enter code: ABCD-1234", deviceCode: { userCode: "ABCD-1234", verificationUri: "https://github.com/login/device", @@ -1656,6 +1657,7 @@ describe("SettingsModal", () => { await userEvent.click(within(copilotCard).getByRole("button", { name: "Login" })); expect(await within(copilotCard).findByText("ABCD-1234")).toBeInTheDocument(); + expect(within(copilotCard).queryByTestId("auth-login-instructions-github-copilot")).not.toBeInTheDocument(); await userEvent.click(within(copilotCard).getByRole("button", { name: "Copy code" })); expect(writeText).toHaveBeenCalledWith("ABCD-1234");