import type { Metadata } from "next"; import { startTwoFactorSetupAction } from "@/app/actions/settings"; import { BRAND } from "@/components/brand"; import { LockIcon } from "@/components/icons"; import { SettingsRow, SettingsSection } from "@/components/metal"; import { QrCode } from "@/components/qr-code"; import { PlateBody, PlateFooter, PlateSection } from "@/components/settings-plate"; import { Button, Label, PageTitle } from "@/components/ui"; import { requireViewer } from "@/lib/auth"; import { formatDate } from "@/lib/format"; import { groupSecret, otpauthUri } from "@/lib/totp"; import { twoFactorStatus } from "@/lib/two-factor"; import { DisableTwoFactorForm, EnableTwoFactorForm, RegenerateRecoveryCodesForm } from "./forms"; export const metadata: Metadata = { title: "Two-factor authentication" }; export default async function SecuritySettingsPage() { const viewer = await requireViewer("/settings/security"); const status = await twoFactorStatus(viewer.id); return (
{status.enabled ? ( <> Two-factor authentication } detail={status.enabledAt ? `Turned on ${formatDate(status.enabledAt)}` : undefined} /> ) : status.pendingSecret ? ( } /> ) : (

Two-factor authentication

With it on, someone who learns your password still can’t sign in without your phone. Git over SSH and HTTPS, API tokens and connected apps keep working as they are.

)}
); }