Skip to content
rw3iss Auth

TwoFactorDisableForm

form @rw3iss/auth-client/preact/forms/TwoFactorDisableForm framework-adapters/preact/components/forms/TwoFactorDisableForm.tsx ↗

Disable 2FA. Server requires BOTH the current password and a fresh TOTP code as defense against accidental / hijack-driven disable. On success, the user’s token-version is bumped so every existing session learns 2FA is off (otherwise users could see stale UI).

Usage

import { TwoFactorDisableForm } from '@rw3iss/auth-client/preact/forms';
<TwoFactorDisableForm
onSuccess={(resp) => navigate("/")}
onError={(err) => console.error(err)}
/>

Props

NameTypeDescription
clientAuthClient
onSuccess() => void
onError(err: Error) => void
classNamestring