TypeScript 61.9%
HTML 37.2%
SQL 0.7%
1import type { Metadata } from 'next';2import { redirect } from 'next/navigation';3import { getPending } from '@/lib/auth/pending';4import { MfaForm } from './mfa-form';56export const metadata: Metadata = { title: 'Two-step verification', robots: { index: false } };78export default async function MfaPage() {9 const p = await getPending();10 if (!p) redirect('/login?expired=1');11 if (p.stage === 'verify') redirect('/verify');12 return (13 <>14 <h1 className="text-xl font-semibold tracking-tight">Two-step verification</h1>15 <p className="mt-1 text-sm text-muted">{p.stage === 'totp' ? 'Enter the 6-digit code from your authenticator app.' : <>We e-mailed a 6-digit sign-in code to <span className="font-medium text-fg">{p.email}</span> because this device is new.</>}</p>16 <MfaForm stage={p.stage === 'totp' ? 'totp' : 'email_code'} />17 </>18 );19}20