btcpayserver/BTCPayServer/Views/Manage/TwoFactorAuthentication.cshtml
2020-07-08 19:19:29 +02:00

61 lines
2.1 KiB
Text

@model TwoFactorAuthenticationViewModel
@{
ViewData.SetActivePageAndTitle(ManageNavPages.TwoFactorAuthentication, "Two-factor authentication");
}
@if(Model.Is2faEnabled)
{
if(Model.RecoveryCodesLeft == 0)
{
<div class="alert alert-danger">
<h4 class="alert-heading mb-3">
<span class="fa fa-warning"></span>
You have no recovery codes left.
</h4>
<p class="mb-0">You must <a asp-action="GenerateRecoveryCodes" class="alert-link">generate a new set of recovery codes</a> before you can log in with a recovery code.</p>
</div>
}
else if(Model.RecoveryCodesLeft == 1)
{
<div class="alert alert-danger">
<h4 class="alert-heading mb-3">
<span class="fa fa-warning"></span>
You have 1 recovery code left.
</h4>
<p class="mb-0">You can <a asp-action="GenerateRecoveryCodes" class="alert-link">generate a new set of recovery codes</a>.</p>
</div>
}
else if(Model.RecoveryCodesLeft <= 3)
{
<div class="alert alert-warning">
<h4 class="alert-heading mb-3">
<span class="fa fa-warning"></span>
You have @Model.RecoveryCodesLeft recovery codes left.
</h4>
<p class="mb-0">You should <a asp-action="GenerateRecoveryCodes" class="alert-link">generate a new set of recovery codes</a>.</p>
</div>
}
<h5>Your current 2FA</h5>
<ul>
<li><a asp-action="Disable2faWarning">Disable 2FA</a></li>
<li><a asp-action="GenerateRecoveryCodes">Reset recovery codes</a></li>
</ul>
}
<h5 class="mt-4">Authenticator app</h5>
<ul>
@if(!Model.HasAuthenticator)
{
<li><a asp-action="EnableAuthenticator">Add authenticator app</a></li>
}
else
{
<li><a asp-action="EnableAuthenticator">Configure authenticator app</a></li>
<li><a asp-action="ResetAuthenticatorWarning">Reset authenticator key</a></li>
}
</ul>
@section Scripts {
@await Html.PartialAsync("_ValidationScriptsPartial")
}