Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix: open subscription login in external browser

rubenluetke10-beep5a26ab6996b1
diff --git a/jarvis/ui/web/frontend/src/components/AgentAccountsPanel.test.tsx b/jarvis/ui/web/frontend/src/components/AgentAccountsPanel.test.tsx
index f9d1c7e639..f4256a1cb1 100644
--- a/jarvis/ui/web/frontend/src/components/AgentAccountsPanel.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/AgentAccountsPanel.test.tsx
@@ -20,6 +20,7 @@ import {
startLoginFlow,
submitLoginFlowCode,
} from "@/lib/agentAccountsApi";
+import { openExternalUrl } from "@/lib/openExternal";
vi.mock("@/lib/agentAccountsApi", async () => {
const actual = await vi.importActual<typeof import("@/lib/agentAccountsApi")>(
@@ -40,6 +41,10 @@ vi.mock("@/lib/agentAccountsApi", async () => {
};
});
+vi.mock("@/lib/openExternal", () => ({
+ openExternalUrl: vi.fn(async () => undefined),
+}));
+
function account(over: Partial<Record<string, unknown>> = {}) {
return {
id: "claude:default",
@@ -110,6 +115,7 @@ beforeEach(() => {
vi.mocked(startLoginFlow).mockReset();
vi.mocked(getLoginFlow).mockReset();
vi.mocked(submitLoginFlowCode).mockReset();
+ vi.mocked(openExternalUrl).mockReset();
});
describe("AgentAccountsPanel", () => {
@@ -199,6 +205,10 @@ describe("AgentAccountsPanel", () => {
// into a private window, not auto-opened and gone.
const url = await screen.findByTestId("login-flow-url");
expect(url.textContent).toContain("claude.ai/oauth/authorize");
+ fireEvent.click(screen.getByRole("button", { name: "Open" }));
+ expect(openExternalUrl).toHaveBeenCalledWith(
+ "https://claude.ai/oauth/authorize?client_id=abc&state=xyz",
+ );
fireEvent.change(
screen.getByPlaceholderText("Paste the code from the browser here"),
diff --git a/jarvis/ui/web/frontend/src/components/AgentAccountsPanel.tsx b/jarvis/ui/web/frontend/src/components/AgentAccountsPanel.tsx
index 03206afcf9..4280220967 100644
--- a/jarvis/ui/web/frontend/src/components/AgentAccountsPanel.tsx
+++ b/jarvis/ui/web/frontend/src/components/AgentAccountsPanel.tsx
@@ -55,6 +55,7 @@ import {
submitLoginFlowCode,
} from "@/lib/agentAccountsApi";
import { robustCopy, robustPaste } from "@/lib/clipboard";
+import { openExternalUrl } from "@/lib/openExternal";
import { useEventStore } from "@/store/events";
import { cn } from "@/lib/utils";
@@ -597,15 +598,14 @@ function LoginFlowBox({
<Copy className="h-3 w-3" />
{t("agent_accounts.flow.copy")}
</button>
- <a
- href={flow.url}
- target="_blank"
- rel="noreferrer noopener"
+ <button
+ type="button"
+ onClick={() => void openExternalUrl(flow.url!)}
className="inline-flex shrink-0 items-center gap-1 rounded-lg border border-border px-2 py-1 text-[11px] hover:border-primary/40"
>
<ExternalLink className="h-3 w-3" />
{t("agent_accounts.flow.open")}
- </a>
+ </button>
</div>
<p className="text-[10px] leading-relaxed text-muted-foreground">
{t("agent_accounts.flow.link_hint")}