From eec770514989663e25d161bedd90074506b56c74 Mon Sep 17 00:00:00 2001 From: Nam Rodriguez Date: Wed, 4 Nov 2026 14:04:52 -0500 Subject: [PATCH 1/2] Sign-in says what forgot-password did and who sends it; People shows who hasn't signed in here Forgot password shows the install's answer for that email (a reset code, a set-up link instead, an invite to use, or no account here) and names the sender to look for, so a person can ask IT to allow it. Members and roles: someone copied from the previous CoderHelm shows "Hasn't signed in here yet" instead of their old activity time, with a Send set-up email button on the row and "Can sign in with GitHub" when it works. A banner counts them and sends set-up emails to all. --- dashboard/e2e/sign-in-methods.spec.ts | 72 ++++++++++++++++- dashboard/e2e/team.spec.ts | 81 ++++++++++++++++++- dashboard/src/app/settings/team/page.tsx | 90 +++++++++++++++++++--- dashboard/src/components/client-shell.tsx | 58 +++++++++++--- dashboard/src/hooks/use-sign-in-methods.ts | 7 +- dashboard/src/lib/api.ts | 19 ++++- dashboard/src/lib/team.ts | 21 ++++- 7 files changed, 322 insertions(+), 26 deletions(-) diff --git a/dashboard/e2e/sign-in-methods.spec.ts b/dashboard/e2e/sign-in-methods.spec.ts index 6c98a42d..115721b1 100644 --- a/dashboard/e2e/sign-in-methods.spec.ts +++ b/dashboard/e2e/sign-in-methods.spec.ts @@ -7,9 +7,10 @@ import { expect, test, type Page, type Route } from "@playwright/test"; // install checks the account itself. An install with neither shows no GitHub // button. Every API call is answered here. -type Methods = { password: boolean; google: boolean; github: boolean }; +type Methods = { password: boolean; google: boolean; github: boolean; senders?: { setup: string | null; reset_codes: string | null } }; +type ForgotReply = { status: string; message: string; email?: string }; -async function mockApi(page: Page, opts: { selfHosted: boolean; methods: Methods | "missing"; status?: string }) { +async function mockApi(page: Page, opts: { selfHosted: boolean; methods: Methods | "missing"; status?: string; forgot?: ForgotReply }) { const calls: string[] = []; const json = (route: Route, body: unknown, status = 200) => route.fulfill({ status, contentType: "application/json", body: JSON.stringify(body) }); @@ -31,6 +32,7 @@ async function mockApi(page: Page, opts: { selfHosted: boolean; methods: Methods ? json(route, { user_id: "u_1", team_id: "t_1", github_login: "a-dev", email: "dev@acme.example", avatar_url: "", role: "owner", status: opts.status }) : json(route, { error: "unauthorized" }, 401); } + if (p === "/auth/forgot-password" && opts.forgot) return json(route, opts.forgot); if (p === "/api/usage") return json(route, { month: "2026-01", tokens_in: 0, tokens_out: 0, total_runs: 0, total_tokens: 0, max_tokens: 0 }); if (p === "/api/banners") return json(route, { banners: [] }); if (p === "/api/teams") return json(route, { teams: [{ team_id: "t_1", org: "acme", status: "deactivated", current: true }] }); @@ -124,3 +126,69 @@ test("removed GitHub app: 'sign in with GitHub again' only where GitHub sign-in await page.goto("/"); await expect(page.getByRole("link", { name: "Then sign in with GitHub again" })).toHaveAttribute("href", /^\/auth\/github$/); }); + +// Forgot password on a self-hosted install says what happened for that email, and where the +// email comes from, so someone whose mail filter holds it back can ask IT to allow it. +const SENDERS = { setup: "coderhelm@acme.example", reset_codes: "no-reply@verificationemail.com" }; + +async function askForReset(page: Page, email: string) { + await page.goto("/"); + await page.getByRole("button", { name: "Forgot password?" }).click(); + await page.getByLabel("Email").fill(email); + await page.getByRole("button", { name: "Send", exact: true }).click(); +} + +test("forgot password, account here: the code is on its way from Amazon Cognito's address", async ({ page }) => { + const { calls } = await mockApi(page, { + selfHosted: true, + methods: { password: true, google: false, github: false, senders: SENDERS }, + forgot: { status: "code_sent", message: "We sent a reset code to jo@acme.example.", email: "jo@acme.example" }, + }); + await askForReset(page, "jo@acme.example"); + await expect(page.getByRole("status").filter({ hasText: "sent" })).toHaveText("We sent a reset code to jo@acme.example."); + await expect(page.getByTestId("sender-note")).toContainText( + "The reset code comes from no-reply@verificationemail.com (Amazon Cognito, which signs people in here).", + ); + await expect(page.getByTestId("sender-note")).toContainText("ask IT to allow that address"); + await expect(page.getByLabel("Reset code")).toBeVisible(); + expect(calls).toContain("/auth/forgot-password"); +}); + +test("forgot password, on the team with no account here: a set-up link instead, from the install's sender", async ({ page }) => { + await mockApi(page, { + selfHosted: true, + methods: { password: true, google: false, github: false, senders: SENDERS }, + forgot: { status: "setup_sent", message: "You don't have an account here yet. We sent you a set-up link instead." }, + }); + await askForReset(page, "al@acme.example"); + await expect(page.getByRole("status").filter({ hasText: "sent" })).toHaveText("You don't have an account here yet. We sent you a set-up link instead."); + await expect(page.getByTestId("sender-note")).toContainText("The set-up link comes from coderhelm@acme.example."); + await expect(page.getByTestId("sender-note")).not.toContainText("verificationemail.com"); + // No code to type: the link in the email sets up the account. + await expect(page.getByLabel("Reset code")).toHaveCount(0); +}); + +test("forgot password, not on this install: says so, sends nothing, no sender line", async ({ page }) => { + await mockApi(page, { + selfHosted: true, + methods: { password: true, google: false, github: false, senders: SENDERS }, + forgot: { status: "no_account", message: "There's no account for who@else.example on this CoderHelm. Ask an admin to add you." }, + }); + await askForReset(page, "who@else.example"); + await expect(page.getByRole("alert").filter({ hasText: "no account" })).toHaveText( + "There's no account for who@else.example on this CoderHelm. Ask an admin to add you.", + ); + await expect(page.getByTestId("sender-note")).toHaveCount(0); + await expect(page.getByLabel("Reset code")).toHaveCount(0); +}); + +test("forgot password with an SES sender for Cognito: that address, not Cognito's", async ({ page }) => { + await mockApi(page, { + selfHosted: true, + methods: { password: true, google: false, github: false, senders: { setup: "coderhelm@acme.example", reset_codes: "noreply@acme.example" } }, + forgot: { status: "code_sent", message: "We sent a reset code to jo@acme.example." }, + }); + await askForReset(page, "jo@acme.example"); + await expect(page.getByTestId("sender-note")).toContainText("The reset code comes from noreply@acme.example."); + await expect(page.getByTestId("sender-note")).not.toContainText("Amazon Cognito"); +}); diff --git a/dashboard/e2e/team.spec.ts b/dashboard/e2e/team.spec.ts index d2872fc9..366b8fea 100644 --- a/dashboard/e2e/team.spec.ts +++ b/dashboard/e2e/team.spec.ts @@ -111,6 +111,8 @@ interface Backend { changes: { at: string; actor: string; action: string; role_id: string; role_name: string; detail: string }[]; /** You hold this custom role (your record's role); requests run as `selfRole`. */ selfCustom?: string; + /** GitHub sign-in works here (`GET /auth/methods`). */ + githubSignIn?: boolean; } // The gateway's rules for custom roles, as the mock answers them. @@ -140,6 +142,22 @@ async function mockApi(page: Page, selfRole = "admin", init: Partial = const body = req.postData() ? (JSON.parse(req.postData() as string) as Record) : null; db.calls.push({ method, path: p, body, search: url.search }); const self = db.members.find((m) => m.is_self); + if (p === "/auth/methods") return json(route, { password: true, google: false, github: db.githubSignIn ?? false }); + if (p === "/api/users/setup-emails" && method === "POST") { + if (LEVEL[selfRole] < 3) return json(route, { error: "Only admins and owners can do that." }, 403); + const hour = Date.now() - 3600_000; + const sent_at: Record = {}; + let skipped = 0; + for (const m of db.members.filter((x) => x.needs_setup)) { + if (m.setup_email_sent_at && new Date(m.setup_email_sent_at).getTime() > hour) { + skipped += 1; + continue; + } + m.setup_email_sent_at = new Date().toISOString(); + sent_at[m.user_id] = m.setup_email_sent_at; + } + return json(route, { sent: Object.keys(sent_at).length, skipped_recent: skipped, failed: 0, sent_at }); + } if (p === "/api/me") return json(route, { user_id: self?.user_id ?? "u-admin", team_id: "t_1", github_login: null, email: self?.email ?? "", avatar_url: "", role: selfRole }); if (p === "/api/usage") return json(route, { month: "2026-01", total_tokens: 0, tokens_in: 0, tokens_out: 0, total_runs: 0, max_tokens: 0 }); if (p === "/api/banners") return json(route, { banners: [] }); @@ -483,13 +501,15 @@ test("self-hosted: a member who never signed in here gets a set-up email from th const mia = db.members.find((x) => x.user_id === "u-mem")!; mia.needs_setup = true; await page.goto("/settings/team"); - await expect(row(page, "Mia Member").getByTestId("setup-status")).toHaveText("Hasn't set up an account here yet"); + await expect(row(page, "Mia Member").getByTestId("setup-status")).toHaveText("Hasn't signed in here yet"); // Only that member: everyone else has signed in here. await expect(members(page).getByTestId("setup-status")).toHaveCount(1); + await expect(row(page, "Mia Member").getByRole("button", { name: "Send set-up email" })).toBeVisible(); await row(page, "Mia Member").getByRole("button", { name: "More actions for Mia Member" }).click(); await page.getByRole("menuitem", { name: "Send set-up email" }).click(); await expect(page.getByText("Set-up email sent to mia@example.com")).toBeVisible(); - await expect(row(page, "Mia Member").getByTestId("setup-status")).toHaveText(/^Set-up email sent /); + await expect(row(page, "Mia Member").getByTestId("setup-sent")).toHaveText(/^Set-up email sent /); + await expect(row(page, "Mia Member").getByRole("button", { name: "Send the set-up email again" })).toBeVisible(); expect(db.calls.some((c) => c.method === "POST" && c.path === "/api/users/u-mem/setup-email")).toBe(true); // Sent before: the menu says it goes again. await row(page, "Mia Member").getByRole("button", { name: "More actions for Mia Member" }).click(); @@ -497,6 +517,63 @@ test("self-hosted: a member who never signed in here gets a set-up email from th await shot(page, "team-setup-email"); }); +test("self-hosted: someone copied over shows they haven't signed in here, not their old activity", async ({ page }) => { + const db = await mockApi(page, "admin", { githubSignIn: true }); + db.members.push( + member({ user_id: "u-al", email: "al.chan@acme.example", name: "Al Chan", github_login: "achan", github_id: "777", sign_in: "email_and_github", last_active_at: ago(5 * DAY), needs_setup: true }), + ); + await page.goto("/settings/team"); + const al = row(page, "Al Chan"); + await expect(al.getByTestId("setup-status")).toHaveText("Hasn't signed in here yet"); + await expect(al).not.toContainText("Active 5 days ago"); + await expect(al.getByTestId("previous-activity")).toHaveText("Last active on the previous Coderhelm, 5 days ago"); + await expect(al.getByTestId("github-sign-in")).toHaveText("Can sign in with GitHub (achan)"); + await expect(al.getByRole("button", { name: "Send set-up email" })).toBeVisible(); + // People who signed in here keep their plain activity time. + await expect(row(page, "Sam Rivera")).toContainText("Active 5 days ago"); + await expect(page.getByText("· 1 haven't signed in here yet")).toBeVisible(); +}); + +test("self-hosted: without GitHub sign-in, no GitHub line for someone copied over", async ({ page }) => { + const db = await mockApi(page, "admin", { githubSignIn: false }); + db.members.push(member({ user_id: "u-al", email: "al.chan@acme.example", name: "Al Chan", github_login: "achan", github_id: "777", needs_setup: true })); + await page.goto("/settings/team"); + await expect(row(page, "Al Chan").getByTestId("setup-status")).toBeVisible(); + await expect(row(page, "Al Chan").getByTestId("github-sign-in")).toHaveCount(0); +}); + +test("self-hosted: the banner counts who hasn't set up an account and sends to all, skipping the last hour", async ({ page }) => { + const db = await mockApi(page); + const mia = db.members.find((x) => x.user_id === "u-mem")!; + const jo = db.members.find((x) => x.user_id === "u-jo")!; + const sam = db.members.find((x) => x.user_id === "u-sam")!; + mia.needs_setup = true; + sam.needs_setup = true; + jo.needs_setup = true; + jo.setup_email_sent_at = ago(20 * 60_000); + await page.goto("/settings/team"); + const banner = page.getByTestId("setup-banner"); + await expect(banner).toContainText("3 people haven't set up an account here yet"); + await expect(page.getByText("· 3 haven't signed in here yet")).toBeVisible(); + await banner.getByRole("button", { name: "Send set-up emails to all" }).click(); + await expect(page.getByText("Set-up email sent to 2 people. 1 person got one in the last hour and was skipped.")).toBeVisible(); + expect(db.calls.filter((c) => c.method === "POST" && c.path === "/api/users/setup-emails")).toHaveLength(1); + await expect(row(page, "Mia Member").getByTestId("setup-sent")).toHaveText(/^Set-up email sent /); + await expect(row(page, "Sam Rivera").getByTestId("setup-sent")).toHaveText(/^Set-up email sent /); + await shot(page, "team-setup-banner"); +}); + +test("the set-up banner has no send button for someone who can't invite", async ({ page }) => { + const db = await mockApi(page, "member"); + db.members.find((x) => x.user_id === "u-sam")!.needs_setup = true; + await page.goto("/settings/team"); + const banner = page.getByTestId("setup-banner"); + await expect(banner).toContainText("1 person hasn't set up an account here yet"); + await expect(banner).toContainText("Ask an admin to send them the set-up email."); + await expect(banner.getByRole("button", { name: "Send set-up emails to all" })).toHaveCount(0); + await expect(row(page, "Sam Rivera").getByRole("button", { name: "Send set-up email" })).toHaveCount(0); +}); + test("no set-up email for members who signed in, or for someone who can't invite", async ({ page }) => { await mockApi(page); await page.goto("/settings/team"); diff --git a/dashboard/src/app/settings/team/page.tsx b/dashboard/src/app/settings/team/page.tsx index 9d49373b..47c38969 100644 --- a/dashboard/src/app/settings/team/page.tsx +++ b/dashboard/src/app/settings/team/page.tsx @@ -18,7 +18,9 @@ import { isGithubOnly, isLinkTarget, isValidEmail, + bulkSetupSummary, linkSuggestions, + people, matchScore, relativeTime, roleLadder, @@ -42,6 +44,7 @@ import { Select as SharedSelect } from "@/components/select"; import { SectionHeading } from "@/components/page"; import { Menu } from "@/components/menu"; import { RolesMatrix } from "@/components/roles-matrix"; +import { useSignInMethods } from "@/hooks/use-sign-in-methods"; import { CustomRoles } from "@/components/custom-roles"; const ROLE_STYLE: Record = { @@ -127,6 +130,10 @@ function TeamPage() { const active = useMemo(() => (members ?? []).filter((m) => m.status === "active"), [members]); const invites = useMemo(() => (members ?? []).filter((m) => m.status === "invited"), [members]); const owners = active.filter((m) => m.role === "owner").length; + // Copied from another Coderhelm and never signed in here (self-hosted). + const notSetUp = useMemo(() => active.filter((m) => m.needs_setup), [active]); + const githubSignIn = useSignInMethods().github; + const [bulkBusy, setBulkBusy] = useState(false); const suggestions = useMemo(() => (canManagePeople ? linkSuggestions(active) : []), [active, canManagePeople]); const shown = useMemo(() => { @@ -218,6 +225,20 @@ function TeamPage() { } }; + const setupEmailsAll = async () => { + setBulkBusy(true); + try { + const r = await teamApi.setupEmailsAll(); + const sentAt = r.sent_at ?? {}; + setMembers((prev) => prev?.map((x) => (sentAt[x.user_id] ? { ...x, setup_email_sent_at: sentAt[x.user_id] } : x)) ?? null); + toast(bulkSetupSummary(r), r.failed > 0 ? "error" : undefined); + } catch (e) { + toast(errorText(e), "error"); + } finally { + setBulkBusy(false); + } + }; + const link = async (person: Member, github: Member) => { setBusy(person.user_id); try { @@ -241,7 +262,8 @@ function TeamPage() { lead={ <> {teamName ? {teamName} : "This workspace"} - {members ? ` · ${active.length} ${active.length === 1 ? "person" : "people"}` : ""} + {members ? ` · ${people(active.length)}` : ""} + {members && notSetUp.length > 0 ? ` · ${notSetUp.length} haven't signed in here yet` : ""} {". "} Who has access, what their role lets them do, and pending invites. @@ -278,6 +300,30 @@ function TeamPage() { /> )} + {notSetUp.length > 0 && ( +
+ + {bulkBusy ? "Sending…" : "Send set-up emails to all"} + + ) : undefined + } + > +

+ They're on the team, copied from the previous Coderhelm, but can't sign in here until they set a password from the + set-up email{githubSignIn ? " or sign in with their linked GitHub account" : ""}. + {canInvites ? " Anyone sent one in the last hour is skipped." : " Ask an admin to send them the set-up email."} +

+
+
+ )} + {suggestions.length > 0 && (
@@ -369,6 +415,7 @@ function TeamPage() { onRemove={() => remove(m)} onLink={() => setLinking(m)} onSetupEmail={canInvites ? () => setupEmail(m) : undefined} + githubSignIn={githubSignIn} roleLabel={roleLabel} /> ))} @@ -523,6 +570,7 @@ function MemberRow({ onRemove, onLink, onSetupEmail, + githubSignIn, roleLabel, }: { m: Member; @@ -537,6 +585,8 @@ function MemberRow({ onLink: () => void; /** Admins on a self-hosted install: email the link to set up their account here. */ onSetupEmail?: () => void; + /** GitHub sign-in works on this deployment (`GET /auth/methods`). */ + githubSignIn?: boolean; roleLabel: (key: string) => string; }) { const githubOnly = isGithubOnly(m); @@ -549,9 +599,12 @@ function MemberRow({ if (manageable && linkable) { actions.push({ label: githubOnly ? "Link to a member who signs in with email…" : "Link a GitHub sign-in…", onSelect: onLink }); } - const setup = Boolean(m.needs_setup && onSetupEmail); + // On the team but never signed in here: its activity time is from the previous Coderhelm. + const notHere = Boolean(m.needs_setup); + const setup = Boolean(notHere && onSetupEmail); + const setupLabel = m.setup_email_sent_at ? "Send the set-up email again" : "Send set-up email"; if (setup && onSetupEmail) { - actions.push({ label: m.setup_email_sent_at ? "Send the set-up email again" : "Send set-up email", onSelect: onSetupEmail }); + actions.push({ label: setupLabel, onSelect: onSetupEmail }); } if (manageable) { actions.push({ @@ -583,11 +636,21 @@ function MemberRow({ m.email && m.email !== name ? {m.email} : null, m.github_login ? : null, githubOnly ? Signs in with GitHub : null, - {seen ? `Active ${seen}` : "Not signed in yet"}, - setup ? ( - - {m.setup_email_sent_at ? `Set-up email sent ${shortDate(m.setup_email_sent_at)}` : "Hasn't set up an account here yet"} + notHere ? ( + + Hasn't signed in here yet + ) : ( + {seen ? `Active ${seen}` : "Not signed in yet"} + ), + notHere && m.setup_email_sent_at ? ( + {`Set-up email sent ${shortDate(m.setup_email_sent_at)}`} + ) : null, + notHere && m.github_login && githubSignIn ? ( + {`Can sign in with GitHub (${m.github_login})`} + ) : null, + notHere && seen ? ( + {`Last active on the previous Coderhelm, ${seen}`} ) : null, ]} chips={ @@ -610,9 +673,16 @@ function MemberRow({ } actions={ actions.length > 0 ? ( - // On a phone the menu sits at the row's top right instead of on a line of its own. - - + + {setup && onSetupEmail && ( + + )} + {/* On a phone the menu sits at the row's top right instead of on a line of its own. */} + + + ) : ( diff --git a/dashboard/src/components/client-shell.tsx b/dashboard/src/components/client-shell.tsx index 77f18f84..15bbd1d7 100644 --- a/dashboard/src/components/client-shell.tsx +++ b/dashboard/src/components/client-shell.tsx @@ -4,7 +4,7 @@ import { can } from "@/lib/capabilities"; import Link from "next/link"; import { usePathname, useRouter } from "next/navigation"; import { type ReactNode, useEffect, useRef, useState } from "react"; -import { api, ApiError, TEAM_MOVED, TWO_FACTOR_REQUIRED, movedUrl, type UsageInfo, type Banner, type TeamInfo } from "@/lib/api"; +import { api, ApiError, TEAM_MOVED, TWO_FACTOR_REQUIRED, movedUrl, type ForgotStatus, type SignInSenders, type UsageInfo, type Banner, type TeamInfo } from "@/lib/api"; import { pushToDataLayer } from "@/lib/gtm"; import { formatTokens, limitName, reachedLimit, USAGE_CHANGED, usageBreakdown, usageLimits } from "@/lib/usage"; import { TokenMeters } from "@/components/token-meters"; @@ -996,6 +996,30 @@ const USE_PASSWORD = "two_factor_use_password"; const USE_PASSWORD_MESSAGE = "Your two-factor code is on your password account. Sign in with your email and password, then enter the code from your authenticator app."; +/** Amazon Cognito's own sender, when the install's user pool sends its emails itself. */ +const COGNITO_DEFAULT_SENDER = "no-reply@verificationemail.com"; + +/** + * Where the email that forgot-password just sent comes from, so a person whose mail filter + * holds it back can ask IT to allow that address. Shown only when the install said who sends. + */ +function SenderNote({ status, senders }: { status: ForgotStatus | null; senders?: SignInSenders }) { + if (!status || !senders) return null; + let line = ""; + if (status === "code_sent" && senders.reset_codes) { + const who = senders.reset_codes === COGNITO_DEFAULT_SENDER ? " (Amazon Cognito, which signs people in here)" : ""; + line = `The reset code comes from ${senders.reset_codes}${who}.`; + } else if ((status === "setup_sent" || status === "setup_recent") && senders.setup) { + line = `The set-up link comes from ${senders.setup}.`; + } + if (!line) return null; + return ( +

+ {line} Not in your inbox after a few minutes? Check spam or quarantine, or ask IT to allow that address. +

+ ); +} + function AuthScreen({ onAuth }: { onAuth: (user: User) => void }) { const [view, setView] = useState("login"); const [email, setEmail] = useState(""); @@ -1010,6 +1034,8 @@ function AuthScreen({ onAuth }: { onAuth: (user: User) => void }) { const [error, setError] = useState(""); const [loading, setLoading] = useState(false); const [message, setMessage] = useState(""); + // What forgot-password last did (a self-hosted install says which case it was). + const [forgotStatus, setForgotStatus] = useState(null); const [problem, setProblem] = useState(null); // How a self-hosted install's account form was opened: an admin's invite email or the // installer's first-admin link. Without either it has no open sign-up. @@ -1156,13 +1182,21 @@ function AuthScreen({ onAuth }: { onAuth: (user: User) => void }) { }; const handleForgot = async () => { - setError(""); setLoading(true); + setError(""); setMessage(""); setForgotStatus(null); setLoading(true); try { - await api.forgotPassword(email); - setView("reset"); - setMessage("If an account exists, a reset code was sent to your email."); - } catch { - setError("We couldn't send a reset code. Check your connection and try again."); + const r = await api.forgotPassword(email); + setForgotStatus(r.status); + if (r.status === "code_sent" || r.status === "sent") { + setView("reset"); + setMessage(r.status === "sent" ? "If an account exists, a reset code was sent to your email." : r.message); + } else if (r.status === "no_account") { + setError(r.message); + } else { + // A set-up link (sent now or within the hour), or an invite to use: no code to enter. + setMessage(r.message); + } + } catch (e) { + setError(e instanceof ApiError ? e.message : "We couldn't send a reset code. Check your connection and try again."); } finally { setLoading(false); } }; @@ -1260,6 +1294,8 @@ function AuthScreen({ onAuth }: { onAuth: (user: User) => void }) { )} + {(view === "forgot" || view === "reset") && } + {/* ── Login ── */} {view === "login" && (
@@ -1412,14 +1448,18 @@ function AuthScreen({ onAuth }: { onAuth: (user: User) => void }) { {/* ── Forgot password ── */} {view === "forgot" && (
-

Enter your email to receive a reset code

+

+ {selfHosted + ? "Enter your email. We'll send a reset code, or a set-up link if you don't have an account here yet." + : "Enter your email to receive a reset code"} +

{ setEmail(e.target.value); setError(""); }} onKeyDown={(e) => e.key === "Enter" && handleForgot()} className="w-full rounded-lg bg-zinc-900 border border-zinc-800 px-4 py-2.5 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:border-zinc-600" />