package components import "context" import "strings" type TwoFactorBackupCodesData struct { BackupCodes []string ErrorMessage string SuccessMessage string } templ TwoFactorBackupCodes(ctx context.Context, data TwoFactorBackupCodesData) { @LayoutWithContext("Two-Factor Authentication Backup Codes", ctx) {

Two-Factor Authentication Backup Codes

These codes can be used to login if you lose access to your authenticator app

if data.ErrorMessage != "" { } if data.SuccessMessage != "" { if (strings.Contains(data.SuccessMessage, "IMPORTANT")) { } else { } }
if len(data.BackupCodes) > 0 {

Your Backup Codes

Store these securely for account recovery

for _, code := range data.BackupCodes { if strings.Contains(code, "REDACTED") {
{ code }
} else {
{ code }
} }
if !strings.Contains(data.BackupCodes[0], "REDACTED") { }
} else {

No Backup Codes Available

You don't have any backup codes. Generate new ones for account recovery.

}

Security Information

Backup codes are single-use passwords that allow you to sign in to your account when you don't have access to your authenticator app. Keep these codes in a secure place, such as a password manager or a secure file.

Back to Profile
} }