import { Link, Navigate } from 'react-router-dom' import { pathForFlow } from '../auth' import { Flows, AuthenticatorType } from '../lib/allauth' import { useAuthInfo } from '../auth/hooks' const labels = {} labels[AuthenticatorType.TOTP] = 'Use your authenticator app' labels[AuthenticatorType.RECOVERY_CODES] = 'Use a recovery code' labels[AuthenticatorType.WEBAUTHN] = 'Use security key' export default function AuthenticateFlow (props) { const authInfo = useAuthInfo() if (authInfo?.pendingFlow?.id !== Flows.MFA_AUTHENTICATE) { return } const flow = authInfo.pendingFlow return ( Two-Factor Authentication Your account is protected by two-factor authentication. {props.children} {flow.types.length > 1 ? <>Alternative Options {flow.types.map(typ => { return ( {labels[typ]} ) })} > : null} ) }
Your account is protected by two-factor authentication.