diff --git a/.oxlintrc.json b/.oxlintrc.json
index 721797a..9126f90 100644
--- a/.oxlintrc.json
+++ b/.oxlintrc.json
@@ -26,8 +26,10 @@
"eslint/curly": ["error", "multi-line"],
"node/no-top-level-await": "off",
"oxc/no-optional-chaining": "off",
+ "oxc/no-async-await": "off",
"eslint/eqeqeq": ["off", "smart"],
"eslint/func-style": ["off"],
+ "eslint/max-lines-per-function": "off",
"eslint/id-length": ["warn", { "exceptionPatterns": ["^_", "^[Tertv]$"] }],
"eslint/init-declarations": "off",
"eslint/max-params": ["warn", { "max": 4 }],
diff --git a/packages/graphql/src/index.ts b/packages/graphql/src/index.ts
index 115ec9a..9e991b4 100644
--- a/packages/graphql/src/index.ts
+++ b/packages/graphql/src/index.ts
@@ -62,6 +62,10 @@ export function createYogaServer(
): YogaServerInstance {
const options = fillOptions(_options);
return createYoga({
+ cors: {
+ origin: [...options.origins],
+ credentials: true,
+ },
async context(ctx) {
const anonymous = { db, request: ctx.request, ...options };
const accessToken = getAccessToken(ctx.request.headers);
@@ -92,7 +96,14 @@ function mockTransport() {
const fillOptions = (opt: YogaServerOptions): Required => ({
mailer: opt?.mailer ?? mockTransport(),
emailFrom: opt?.emailFrom ?? "noreply@drfed.org",
- origins: opt?.origins ?? new Set(["https://drfed.org"]),
+ // FIXME: Properly parametrize the following allowlist:
+ origins:
+ opt?.origins ??
+ new Set([
+ "https://drfed.org",
+ "http://localhost:5173",
+ "http://0.0.0.0:5173",
+ ]),
});
const getAccessToken = (headers: Headers) =>
diff --git a/packages/web/src/RelayEnviroment.ts b/packages/web/src/RelayEnviroment.ts
index 0f4c953..66e8f94 100644
--- a/packages/web/src/RelayEnviroment.ts
+++ b/packages/web/src/RelayEnviroment.ts
@@ -21,18 +21,28 @@ import {
RecordSource,
Store,
} from "relay-runtime";
+import { getRequestEvent } from "solid-js/web";
+
+import { readSessionCookie } from "./routes/session.ts";
// oxlint-disable no-async-await
const fetchFn: FetchFunction = async (params, variables) => {
+ const event = getRequestEvent();
+ const accessToken = readSessionCookie(event?.request);
+ const headers: Record = {
+ "Content-Type": "application/json",
+ };
+ if (accessToken !== undefined) {
+ headers.Authorization = `Bearer ${accessToken}`;
+ }
const response = await fetch(import.meta.env.VITE_DRFED_URL, {
method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
+ headers,
body: JSON.stringify({
query: params.text,
variables,
}),
+ credentials: "include",
});
// oxlint-disable return-await no-unsafe-return
diff --git a/packages/web/src/app.css b/packages/web/src/app.css
index 8187644..98da414 100644
--- a/packages/web/src/app.css
+++ b/packages/web/src/app.css
@@ -16,44 +16,300 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
+* {
+ box-sizing: border-box;
+}
+
+html {
+ background: var(--bg);
+ color: var(--ink);
+ font-family: var(--font-sans);
+ font-size: var(--text-body);
+}
+
body {
- font-family:
- Gordita, Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue",
- sans-serif;
+ margin: 0;
+}
+
+button,
+input {
+ font: inherit;
+}
+
+.app-shell {
+ min-height: 100svh;
+}
+
+.app-header {
+ background: color-mix(in srgb, var(--bg) 92%, transparent);
+ border-bottom: 1px solid var(--line);
+ position: sticky;
+ top: 0;
+ z-index: 10;
+}
+
+.app-header-inner {
+ align-items: center;
+ display: flex;
+ height: var(--header-h);
+ margin: 0 auto;
+ max-width: var(--container);
+ padding: 0 var(--gutter);
+}
+
+.brand {
+ align-items: center;
+ color: var(--ink);
+ display: flex;
+ font-family: var(--font-serif);
+ font-size: 1.25rem;
+ font-weight: 700;
+ gap: 0.65rem;
+ letter-spacing: var(--tracking-heading);
+ text-decoration: none;
+}
+
+.brand img {
+ border-radius: 50%;
+}
+
+.app-nav {
+ align-self: stretch;
+ display: flex;
+ gap: 0.25rem;
+ margin-left: clamp(1.5rem, 5vw, 4rem);
+}
+
+.app-nav a,
+.header-action {
+ align-items: center;
+ color: var(--ink-soft);
+ display: flex;
+ font-size: 0.9rem;
+ font-weight: 600;
+ padding: 0 0.85rem;
+ position: relative;
+ text-decoration: none;
}
-a {
- margin-right: 1rem;
+.app-nav a:hover,
+.header-action:hover,
+.app-nav a.is-active,
+.header-action.is-active {
+ color: var(--ink);
}
-main {
- text-align: center;
- padding: 1em;
+.app-nav a.is-active::after {
+ background: var(--accent);
+ bottom: -1px;
+ content: "";
+ height: 3px;
+ left: 0.85rem;
+ position: absolute;
+ right: 0.85rem;
+}
+
+.header-action {
+ border: 1px solid var(--line-strong);
+ border-radius: var(--radius-pill);
+ margin-left: auto;
+ min-height: 2.4rem;
+}
+
+.header-action.is-active {
+ background: var(--accent-tint);
+ border-color: var(--accent-soft);
+}
+
+.app-header a:focus-visible,
+.button:focus-visible {
+ outline: 3px solid var(--accent-soft);
+ outline-offset: 0.2rem;
+}
+
+.app-content {
margin: 0 auto;
+ max-width: var(--container);
+ min-height: calc(100svh - var(--header-h));
+ padding: clamp(2rem, 5vw, 4rem) var(--gutter);
+}
+
+.app-content > main:not(.auth-page) {
+ width: 100%;
+}
+
+.app-content > main:not(.auth-page) :is(h1, h2, p) {
+ margin-top: 0;
+}
+
+.app-content h1,
+.app-content h2 {
+ font-family: var(--font-serif);
+ letter-spacing: var(--tracking-heading);
+}
+
+.app-content h1 {
+ font-size: var(--text-heading-2);
+ line-height: var(--leading-heading);
+}
+
+.app-content p {
+ color: var(--ink-soft);
+ line-height: var(--leading-body);
+}
+
+.auth-page {
+ align-items: center;
+ display: flex;
+ justify-content: center;
+ min-height: calc(100svh - var(--header-h) - clamp(4rem, 10vw, 8rem));
+}
+
+.panel {
+ background: var(--card);
+ border: 1px solid var(--line);
+ border-radius: var(--radius);
+ box-shadow: var(--shadow-sm);
+}
+
+.auth-panel {
+ max-width: 28rem;
+ padding: clamp(1.5rem, 4vw, 2rem);
+ width: 100%;
+}
+
+.panel-header {
+ border-bottom: 1px solid var(--line);
+ margin: 0 calc(clamp(1.5rem, 4vw, 2rem) * -1) 1.5rem;
+ padding: 0 clamp(1.5rem, 4vw, 2rem) 1.5rem;
+}
+
+.panel-header h1 {
+ font-size: 1.65rem;
+ margin: 0 0 0.5rem;
+}
+
+.panel-header p {
+ font-size: 0.95rem;
+ margin: 0;
+}
+
+.auth-panel form {
+ display: grid;
+ gap: 1rem;
+}
+
+.field {
+ display: grid;
+ font-size: 0.9rem;
+ font-weight: 650;
+ gap: 0.75rem;
+}
+
+.field input {
+ background: var(--surface-2);
+ border: 1px solid var(--line-strong);
+ border-radius: var(--radius-sm);
+ color: var(--ink);
+ min-width: 0;
+ padding: 0.9rem 1rem;
+ transition:
+ border-color var(--duration-fast) var(--ease-standard),
+ box-shadow var(--duration-fast) var(--ease-standard);
+}
+
+.field input::placeholder {
+ color: var(--ink-faint);
+}
+
+.field input:focus {
+ border-color: var(--accent);
+ box-shadow: 0 0 0 3px var(--accent-tint);
+ outline: none;
+}
+
+.button {
+ align-items: center;
+ border: 0;
+ border-radius: var(--radius-sm);
+ cursor: pointer;
+ display: inline-flex;
+ font-weight: 700;
+ justify-content: center;
+ min-height: 2.9rem;
+ padding: 0.75rem 1.1rem;
}
-h1 {
- color: #335d92;
- text-transform: uppercase;
- font-size: 4rem;
- font-weight: 100;
- line-height: 1.1;
- margin: 4rem auto;
- max-width: 14rem;
+.button.primary {
+ background: var(--accent);
+ color: var(--on-accent);
+ transition:
+ background var(--duration-fast) var(--ease-standard),
+ transform var(--duration-fast) var(--ease-standard);
}
-p {
- max-width: 14rem;
- margin: 2rem auto;
- line-height: 1.35;
+.button.primary:hover:not(:disabled) {
+ background: var(--accent-strong);
}
-@media (min-width: 480px) {
- h1 {
- max-width: none;
+.button:disabled {
+ cursor: wait;
+ opacity: 0.65;
+}
+
+.notice {
+ background: var(--accent-tint);
+ border-radius: var(--radius-sm);
+ color: var(--ink);
+ line-height: 1.5;
+ margin: 1.25rem 0 0;
+ padding: 0.85rem 1rem;
+}
+
+.notice.error {
+ border-left: 3px solid var(--danger);
+}
+
+.notice.success {
+ border-left: 3px solid var(--accent);
+}
+
+@media (max-width: 600px) {
+ .app-header-inner {
+ padding: 0 1rem;
}
- p {
- max-width: none;
+ .brand span {
+ display: none;
+ }
+
+ .app-nav {
+ margin-left: 0.75rem;
+ }
+
+ .app-nav a,
+ .header-action {
+ padding-inline: 0.65rem;
+ }
+
+ .app-nav a.is-active::after {
+ left: 0.65rem;
+ right: 0.65rem;
+ }
+
+ .app-content {
+ padding: 1.5rem 1rem 3rem;
+ }
+
+ .auth-page {
+ align-items: flex-start;
+ min-height: auto;
+ }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .button.primary,
+ .field input {
+ transition: none;
}
}
diff --git a/packages/web/src/app.tsx b/packages/web/src/app.tsx
index f14a08c..f6373c9 100644
--- a/packages/web/src/app.tsx
+++ b/packages/web/src/app.tsx
@@ -15,10 +15,11 @@
// along with this program. If not, see .
import { MetaProvider, Title } from "@solidjs/meta";
-import { Router } from "@solidjs/router";
+import { A, Router } from "@solidjs/router";
import { FileRoutes } from "@solidjs/start/router";
import { Suspense } from "solid-js";
+import "./drfed.css";
import "./app.css";
import { RelayEnvironmentProvider } from "solid-relay";
@@ -32,10 +33,35 @@ export default function App() {
(
- SolidStart - Basic
- Index
- About
- {props.children}
+ DrFed
+
+
+
+ {props.children}
+
+
)}
>
diff --git a/packages/web/src/drfed.css b/packages/web/src/drfed.css
new file mode 100644
index 0000000..b306ab6
--- /dev/null
+++ b/packages/web/src/drfed.css
@@ -0,0 +1,107 @@
+/*
+DrFed: A web-based platform for developing and debugging ActivityPub apps
+Copyright (C) 2026 DrFed team
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see .
+*/
+
+:root {
+ color-scheme: light;
+
+ /* Typography */
+ --font-serif:
+ "Fraunces Variable", Fraunces, Georgia, "Times New Roman", serif;
+ --font-sans:
+ "Hanken Grotesk Variable", "Hanken Grotesk", system-ui, -apple-system,
+ "Segoe UI", sans-serif;
+ --font-mono:
+ "IBM Plex Mono", ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas,
+ monospace;
+ --text-body: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
+ --text-lede: clamp(1.15rem, 1.05rem + 0.5vw, 1.45rem);
+ --text-heading-1: clamp(2.7rem, 1.9rem + 3.9vw, 4.75rem);
+ --text-heading-2: clamp(1.9rem, 1.5rem + 1.9vw, 2.85rem);
+ --text-heading-3: 1.3rem;
+ --text-label: 0.78rem;
+ --leading-body: 1.65;
+ --leading-heading: 1.08;
+ --tracking-heading: -0.018em;
+ --tracking-label: 0.13em;
+
+ /* Light palette */
+ --bg: #fdfcfb;
+ --bg-tint: #f4f2f0;
+ --surface: #ffffff;
+ --surface-2: #f5f3f1;
+ --card: #ffffff;
+ --ink: #26211f;
+ --ink-soft: #6a615c;
+ --ink-faint: #998f89;
+ --accent: #e45b7d;
+ --accent-strong: #c23a5c;
+ --accent-soft: #f4a9b8;
+ --accent-tint: #f7e3e7;
+ --on-accent: #ffffff;
+ --line: #e9e5e1;
+ --line-strong: #dad4cf;
+ --danger: #cf3f43;
+
+ /* Elevation */
+ --shadow-sm: 0 1px 2px rgb(38 33 31 / 5%), 0 2px 8px rgb(38 33 31 / 4%);
+ --shadow-md: 0 4px 14px rgb(38 33 31 / 6%), 0 12px 36px rgb(38 33 31 / 7%);
+
+ /* Layout */
+ --container: 70rem;
+ --container-narrow: 48rem;
+ --gutter: clamp(1.25rem, 5vw, 3rem);
+ --section-space: clamp(4rem, 3rem + 6vw, 8rem);
+ --header-h: 4.25rem;
+
+ /* Shape */
+ --radius-sm: 0.5rem;
+ --radius: 0.875rem;
+ --radius-lg: 1.5rem;
+ --radius-pill: 999px;
+
+ /* Motion */
+ --duration-fast: 0.18s;
+ --duration-normal: 0.25s;
+ --ease-standard: ease;
+ --ease-reveal: cubic-bezier(0.2, 0.7, 0.2, 1);
+}
+
+@media (prefers-color-scheme: dark) {
+ :root {
+ color-scheme: dark;
+
+ --bg: #181613;
+ --bg-tint: #1e1b17;
+ --surface: #201d19;
+ --surface-2: #272420;
+ --card: #201d19;
+ --ink: #f0ece8;
+ --ink-soft: #bab1aa;
+ --ink-faint: #887f78;
+ --accent: #ef6a88;
+ --accent-strong: #f78da4;
+ --accent-soft: #b34965;
+ --accent-tint: #322a27;
+ --line: #332f2a;
+ --line-strong: #453f39;
+ --danger: #ef726b;
+
+ --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
+ --shadow-md: 0 6px 24px rgb(0 0 0 / 40%);
+ }
+}
diff --git a/packages/web/src/routes/[...404].tsx b/packages/web/src/routes/[...404].tsx
index 25708e8..b5e0971 100644
--- a/packages/web/src/routes/[...404].tsx
+++ b/packages/web/src/routes/[...404].tsx
@@ -25,10 +25,10 @@ export default function NotFound() {
Page Not Found
Visit{" "}
-
- start.solidjs.com
- {" "}
- to learn how to build SolidStart apps.
+
+ DrFed
+
+ : A web-based platform for developing and debugging ActivityPub apps
);
diff --git a/packages/web/src/routes/about.tsx b/packages/web/src/routes/about.tsx
index 34dbe99..84ec70c 100644
--- a/packages/web/src/routes/about.tsx
+++ b/packages/web/src/routes/about.tsx
@@ -20,7 +20,13 @@ export default function About() {
return (
About
- About
+
+ Visit{" "}
+
+ DrFed
+
+ : A web-based platform for developing and debugging ActivityPub apps
+
);
}
diff --git a/packages/web/src/routes/confirm/[slug].tsx b/packages/web/src/routes/confirm/[slug].tsx
new file mode 100644
index 0000000..64d4325
--- /dev/null
+++ b/packages/web/src/routes/confirm/[slug].tsx
@@ -0,0 +1,108 @@
+// DrFed: A web-based platform for developing and debugging ActivityPub apps
+// Copyright (C) 2026 DrFed team
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see .
+
+import { useParams, useSearchParams } from "@solidjs/router";
+import { graphql } from "relay-runtime";
+import { Show, createSignal, onMount } from "solid-js";
+import { createMutation } from "solid-relay";
+
+import type { CompleteLoginChallenge } from "./__generated__/CompleteLoginChallenge.graphql";
+
+const signCompleteMutation = graphql`
+ mutation CompleteLoginChallenge($token: UUID!, $code: String!) {
+ completeLoginChallenge(token: $token, code: $code) {
+ accessToken
+ expires
+ }
+ }
+`;
+
+export default function ConfirmPage() {
+ const params = useParams<{ slug: string }>();
+ const [searchParams] = useSearchParams<{ code?: string }>();
+ const [complete] =
+ createMutation(signCompleteMutation);
+ const [result, setResult] = createSignal<{
+ message: string;
+ status: "error" | "success";
+ }>();
+
+ function showSessionError() {
+ setResult({
+ message: "Unable to save a session",
+ status: "error",
+ });
+ }
+
+ onMount(() => {
+ const { code } = searchParams;
+ const { slug: token } = params;
+
+ if (token === "" || code == undefined || code === "") {
+ return;
+ }
+
+ async function saveSession(accessToken: string, expires: string) {
+ try {
+ const response = await fetch("/session", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ accessToken,
+ expires,
+ }),
+ });
+
+ if (!response.ok) {
+ showSessionError();
+ return;
+ }
+ // Redirect to the home page
+ globalThis.location.assign("/");
+ } catch {
+ showSessionError();
+ }
+ }
+
+ complete({
+ variables: { token, code },
+ onCompleted(data) {
+ const session = data.completeLoginChallenge;
+ if (
+ session?.accessToken == undefined ||
+ typeof session.expires !== "string"
+ ) {
+ setResult({
+ message: "The sign-in link is invalid or expired.",
+ status: "error",
+ });
+ return;
+ }
+
+ void saveSession(session.accessToken, session.expires);
+ },
+ onError: (error) => {
+ setResult({ message: error.message, status: "error" });
+ },
+ });
+ });
+
+ return (
+
+ {(value) => }
+
+ );
+}
diff --git a/packages/web/src/routes/index.tsx b/packages/web/src/routes/index.tsx
index 3db2993..a08e0ee 100644
--- a/packages/web/src/routes/index.tsx
+++ b/packages/web/src/routes/index.tsx
@@ -35,23 +35,17 @@ export default function Home() {
return (
- Hello World
- Hello world!
- 로그인되지 않았습니다.
}>
- {(viewer) => (
-
- {viewer().name}
- {viewer().admin ? " (관리자)" : ""}
-
- )}
+ Home
+ You're not signed in.}>
+ {(viewer) => {viewer().name}
}
Visit{" "}
-
- start.solidjs.com
- {" "}
- to learn how to build SolidStart apps.
+
+ DrFed
+
+ : A web-based platform for developing and debugging ActivityPub apps
);
diff --git a/packages/web/src/routes/session.ts b/packages/web/src/routes/session.ts
new file mode 100644
index 0000000..8e1c11a
--- /dev/null
+++ b/packages/web/src/routes/session.ts
@@ -0,0 +1,111 @@
+// DrFed: A web-based platform for developing and debugging ActivityPub apps
+// Copyright (C) 2026 DrFed team
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see .
+
+import type { APIEvent } from "@solidjs/start/server";
+
+const SESSION_COOKIE = "session";
+const ACCESS_TOKEN_PATTERN = /^[A-Za-z0-9_-]{43}$/u;
+
+// Note: setCookie(nativeEvent, ...) from @solidjs/start/http is intentionally
+// NOT used here. In @solidjs/start 2.0.0-alpha.2, that function produces a
+// malformed Set-Cookie header in both "use server" RPCs and POST API route
+// handlers — the cookie name becomes "[METHOD] URL" instead of the intended
+// name.
+export async function POST({ request }: APIEvent) {
+ let body: unknown;
+ try {
+ body = await request.json();
+ } catch {
+ return new Response(undefined, { status: 400 });
+ }
+ if (typeof body !== "object" || body == undefined) {
+ return new Response(undefined, { status: 400 });
+ }
+
+ const accessToken =
+ "accessToken" in body && typeof body.accessToken === "string"
+ ? body.accessToken
+ : undefined;
+ const expiresValue =
+ "expires" in body && typeof body.expires === "string"
+ ? body.expires
+ : undefined;
+
+ if (accessToken == undefined || expiresValue == undefined) {
+ return new Response(undefined, { status: 400 });
+ }
+
+ if (!ACCESS_TOKEN_PATTERN.test(accessToken)) {
+ return new Response(undefined, { status: 400 });
+ }
+
+ let expires: Temporal.Instant;
+
+ try {
+ expires = Temporal.Instant.from(expiresValue);
+ } catch {
+ return new Response(undefined, { status: 400 });
+ }
+
+ if (expires.epochNanoseconds <= Temporal.Now.instant().epochNanoseconds) {
+ return new Response(undefined, { status: 400 });
+ }
+
+ const cookie = [
+ `${SESSION_COOKIE}=${encodeURIComponent(accessToken)}`,
+ "HttpOnly",
+ "Path=/",
+ "SameSite=Lax",
+ `Expires=${new Date(expires.epochMilliseconds).toUTCString()}`,
+ ...(new URL(request.url).protocol === "https:" ? ["Secure"] : []),
+ ].join("; ");
+
+ return new Response(undefined, {
+ status: 204,
+ headers: { "Set-Cookie": cookie },
+ });
+}
+
+export function readSessionCookie(
+ request: Request | undefined,
+): string | undefined {
+ const cookieHeader = request?.headers.get("cookie");
+
+ if (cookieHeader == undefined || cookieHeader == "") {
+ return undefined;
+ }
+ for (const part of cookieHeader.split(";")) {
+ const eq = part.indexOf("=");
+ if (eq === -1) {
+ continue;
+ }
+ if (part.slice(0, eq).trim() !== SESSION_COOKIE) {
+ continue;
+ }
+ const raw = part.slice(eq + 1).trim();
+ if (raw === "") {
+ return undefined;
+ }
+ let decoded: string;
+ try {
+ decoded = decodeURIComponent(raw);
+ } catch {
+ return undefined;
+ }
+ return ACCESS_TOKEN_PATTERN.test(decoded) ? decoded : undefined;
+ }
+ return undefined;
+}
diff --git a/packages/web/src/routes/sign-in.tsx b/packages/web/src/routes/sign-in.tsx
new file mode 100644
index 0000000..760f3ec
--- /dev/null
+++ b/packages/web/src/routes/sign-in.tsx
@@ -0,0 +1,117 @@
+// DrFed: A web-based platform for developing and debugging ActivityPub apps
+// Copyright (C) 2026 DrFed team
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see .
+
+import { Title } from "@solidjs/meta";
+import { graphql } from "relay-runtime";
+import { type JSX, Show, createSignal } from "solid-js";
+import { createMutation } from "solid-relay";
+
+import type { SignInMutation } from "./__generated__/SignInMutation.graphql";
+
+const signInMutation = graphql`
+ mutation SignInMutation($email: Email!, $verifyUrl: URITemplate) {
+ loginByEmail(email: $email, verifyUrl: $verifyUrl) {
+ token
+ }
+ }
+`;
+
+export default function SignInPage() {
+ const [signIn, isPending] = createMutation(signInMutation);
+ const [result, setResult] = createSignal<{
+ message: string;
+ status: "error" | "success";
+ }>();
+ const buttonLabel = () => {
+ if (isPending()) {
+ return "Sending link…";
+ }
+ if (result()?.status === "success") {
+ return "Resend sign-in link";
+ }
+ return "Send sign-in link";
+ };
+
+ const handleSubmit: JSX.EventHandler = (e) => {
+ e.preventDefault();
+ const email = new FormData(e.currentTarget).get("email");
+ if (typeof email !== "string" || email === "") {
+ return;
+ }
+
+ setResult();
+ signIn({
+ variables: {
+ email,
+ verifyUrl: `${globalThis.location.origin}/confirm/{token}?code={code}`,
+ },
+ onCompleted: (_response, errors) => {
+ const [error] = errors ?? [];
+
+ setResult({
+ message:
+ error?.message ??
+ "Check your inbox for a secure sign-in link. You can close this page.",
+ status: error === undefined ? "success" : "error",
+ });
+ },
+ onError: (error) => {
+ setResult({ message: error.message, status: "error" });
+ },
+ });
+ };
+
+ return (
+
+ Sign in — DrFed
+
+
+
+
+
+
+
+ {(formResult) => (
+
+ {formResult().message}
+
+ )}
+
+
+
+ );
+}
diff --git a/packages/web/tsconfig.json b/packages/web/tsconfig.json
index fe104ea..46a2616 100644
--- a/packages/web/tsconfig.json
+++ b/packages/web/tsconfig.json
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
- "lib": ["DOM", "DOM.Iterable"],
+ "lib": ["DOM", "DOM.Iterable", "ESNext"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",