© 2026 Hedgehog Software, LLC
server config
plugins: [ username(), admin(), twoFactor({ issuer: "example.com", }), ]
mfa setup func
import QRCode from "react-qr-code"; const setupMFA = async (data: IPasswordSchema) => { toast.loading("Generating MFA QR code, please wait...", { id: "mfa-setup", }); const res = await authClient.twoFactor.enable({ password: data.password, }); if (res.error) { toast.error(res.error.message, { id: "mfa-setup", }); setMfaData(null); return; } setMfaData(res.data); toast.success("QR code generated successfully", { id: "mfa-setup", }); }; <QRCode value={totpURI} className="w-full" />
otpauth://totp?secret=mYRiLalafW4Ya04foIhsXX_BGLV8Ccsn&issuer=example.com&account=test%40gmail.com&digits=6&period=30
Error : Cannot interpret OR code