@inherits LocalizableComponentBase @* Two-factor sign-in (TOTP, /clientapi/user/totp), a block of the login's settings (AccountEditor). Off: turned on with the password (setup), then the secret shown as a QR code, as text and as an otpauth:// link an authenticator app opens, and the app's first code (enable); then the ten recovery codes, shown this once. Turning it on ends every other session and every persona token, this device's too, and AuthService.TotpEnable goes on with the JWT PrivaPub answers. On: the recovery codes left, and turned off with the password and a code from the app or a recovery code, asked first. *@
@Localizer["Two-factor sign-in"]
@if (account is { TwoFactorEnabled: true })
{
@Localizer["Save these recovery codes now: they won't be shown again."] @Localizer["Each one signs you in once in place of the app's code, if you lose your phone."]
@Localizer["Signing in takes the password and a code from your authenticator app, or one of your recovery codes."]
@Localizer["Recovery codes left: {0}", account.RecoveryCodesLeft]
@if (account.RecoveryCodesLeft <= FewRecoveryCodes) {@Localizer["Signing in takes a code from an authenticator app on your phone as well as the password, so a stolen password isn't enough."]
@if (setup is not null) {@Localizer["Scan this QR code with your authenticator app, or type the key into it."]
@setup.Secret
@Localizer["Every other device signed in to this login is signed out."]