MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / decide

Function decide

apps/host-selfhost/web/chromeless/device-page.tsx:56–74  ·  view source on GitHub ↗
(accept: boolean)

Source from the content-addressed store, hash-verified

54 }, [userCode]);
55
56 const decide = async (accept: boolean) => {
57 setBusy(accept ? "approve" : "deny");
58 setError(null);
59 const res = await fetch(
60 `${globalThis.location.origin}/api/auth/device/${accept ? "approve" : "deny"}`,
61 {
62 method: "POST",
63 credentials: "include",
64 headers: { "content-type": "application/json" },
65 body: JSON.stringify({ userCode }),
66 },
67 );
68 setBusy(null);
69 if (!res.ok) {
70 setError("Could not record your decision. The code may have expired, try again.");
71 return;
72 }
73 setPhase(accept ? "approved" : "denied");
74 };
75
76 return (
77 <div className="flex min-h-screen items-center justify-center bg-background p-6">

Callers 1

DevicePageFunction · 0.70

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected