@authms/plugin-mfa
v0.2.1
Published
AuthMS MFA Plugin — Multi-Factor Authentication UI components and flows for @authms/react
Maintainers
Readme
@authms/plugin-mfa
AuthMS MFA Plugin — Multi-Factor Authentication UI components and flows for @authms/react.
Components
MfaSetup— guided TOTP setup with QR code display and verificationMfaGuard— wrapper that requires MFA challenge before rendering childrenBackupCodes— display and regenerate one-time backup codesmfaPlugin— plugin factory to register withAuthMS.use()
Install
npm install @authms/core @authms/react @authms/plugin-mfaQuick Start
import { AuthmsProvider, useAuthms } from '@authms/react';
import { MfaSetup, MfaGuard, BackupCodes } from '@authms/plugin-mfa';
function SecurityPage() {
return (
<div>
<h2>Two-Factor Authentication</h2>
<MfaSetup />
<BackupCodes />
</div>
);
}
function Dashboard() {
return (
<MfaGuard>
<h1>Sensitive Content</h1>
</MfaGuard>
);
}See the root SDK README for full documentation.
