package components import "context" type TwoFactorSetupData struct { QRCodeURL string Secret string BackupCodes []string ErrorMessage string } templ TwoFactorSetup(ctx context.Context, data TwoFactorSetupData) { @LayoutWithContext("Two-Factor Authentication Setup", ctx) {

Set Up Two-Factor Authentication

Enhance your account security with 2FA

if data.ErrorMessage != "" { }

1. Scan QR Code

Scan this QR code with your authenticator app (Google Authenticator, Authy, etc.)

QR Code

Can't scan the QR code? Use this code instead:

{ data.Secret }

2. Verify Setup

if len(data.BackupCodes) > 0 {

3. Save Backup Codes

Store these backup codes in a safe place. You can use them to access your account if you lose your authenticator device.

for _, code := range data.BackupCodes {
{ code }
}
}
} }