@using Fido2NetLib @using BTCPayServer.Abstractions.Models @model TwoFactorAuthenticationViewModel @{ ViewData.SetActivePage(ManageNavPages.TwoFactorAuthentication, "Two-Factor Authentication"); }

@ViewData["Title"]

Two-Factor Authentication (2FA) is an additional measure to protect your account. In addition to your password you will be asked for a second proof on login. This can be provided by an app (such as Google or Microsoft Authenticator) or a security device (like a Yubikey or your hardware wallet supporting FIDO2).

App-based 2FA

@if (Model.Is2faEnabled) { if (Model.RecoveryCodesLeft == 0) {

You have no recovery codes left.

You must generate a new set of recovery codes before you can log in with a recovery code.

} else if (Model.RecoveryCodesLeft == 1) {

You only have 1 recovery code left.

You can generate a new set of recovery codes.

} else if (Model.RecoveryCodesLeft <= 3) {

You only have @Model.RecoveryCodesLeft recovery codes left.

You should generate a new set of recovery codes.

} }

Security devices

@if (Model.Credentials.Any()) {
@foreach (var device in Model.Credentials) { var name = string.IsNullOrEmpty(device.Name) ? "Unnamed security device" : device.Name;
@name
@switch (device.Type) { case Fido2Credential.CredentialType.FIDO2: Security device (FIDO2) break; case Fido2Credential.CredentialType.LNURLAuth: Lightning node (LNURL Auth) break; }
@if (device.Type == Fido2Credential.CredentialType.FIDO2) { Remove } else if (device.Type == Fido2Credential.CredentialType.LNURLAuth) { Remove }
}
}