import type { Metadata } from 'next'; import Link from 'next/link'; import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session'; import { Alert, AlertDescription, AlertTitle } from '@documenso/ui/primitives/alert'; import { Button } from '@documenso/ui/primitives/button'; import { SettingsHeader } from '~/components/(dashboard)/settings/layout/header'; import { DisableAuthenticatorAppDialog } from '~/components/forms/2fa/disable-authenticator-app-dialog'; import { EnableAuthenticatorAppDialog } from '~/components/forms/2fa/enable-authenticator-app-dialog'; import { ViewRecoveryCodesDialog } from '~/components/forms/2fa/view-recovery-codes-dialog'; import { PasswordForm } from '~/components/forms/password'; export const metadata: Metadata = { title: 'Security', }; export default async function SecuritySettingsPage() { const { user } = await getRequiredServerComponentSession(); return (
{user.identityProvider === 'DOCUMENSO' && ( <>
)}
Two factor authentication Add an authenticator to serve as a secondary authentication method{' '} {user.identityProvider === 'DOCUMENSO' ? 'when signing in, or when signing documents.' : 'for signing documents.'}
{user.twoFactorEnabled ? ( ) : ( )}
{user.twoFactorEnabled && (
Recovery codes Two factor authentication recovery codes are used to access your account in the event that you lose access to your authenticator app.
)}
Recent activity View all recent security activity related to your account.
); }