import { Link, useLoaderData } from 'react-router-dom' import * as allauth from '../lib/allauth' export async function loader ({ params }) { const resp = await allauth.getAuthenticators() return { authenticators: resp.data } } export default function MFAOverview (props) { const { authenticators } = useLoaderData() const totp = authenticators.find(authenticator => authenticator.type === allauth.AuthenticatorType.TOTP) const webauthn = authenticators.filter(authenticator => authenticator.type === allauth.AuthenticatorType.WEBAUTHN) const recoveryCodes = authenticators.find(authenticator => authenticator.type === allauth.AuthenticatorType.RECOVERY_CODES) return (

Two-Factor Authentication

Authenticator App

{totp ? <>

Authentication using an authenticator app is active.

Deactivate : <>

An authenticator app is not active..

Activate }

Security Keys

{webauthn.length ? <>

You have added {webauthn.length} security keys.

Manage : <>

No security keys have been added.

Add }

Recovery Codes

{!recoveryCodes ? <>

No recovery codes set up.

Generate : <>

There are {recoveryCodes.unused_code_count} out of {recoveryCodes.total_code_count} recovery codes available.

View Regenerate }
) }