import type { Metadata } from 'next'; import Link from 'next/link'; import { IDENTITY_PROVIDER_NAME } from '@documenso/lib/constants/auth'; 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 { AuthenticatorApp } from '~/components/forms/2fa/authenticator-app'; import { RecoveryCodes } from '~/components/forms/2fa/recovery-codes'; 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 Create one-time passwords that serve as a secondary authentication method for confirming your identity when requested during the sign-in process.
{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.
)}
) : ( Your account is managed by {IDENTITY_PROVIDER_NAME[user.identityProvider]} To update your password, enable two-factor authentication, and manage other security settings, please go to your {IDENTITY_PROVIDER_NAME[user.identityProvider]} account settings. )}
Recent activity View all recent security activity related to your account.
); }