2017-09-13 15:47:34 +09:00
@model TwoFactorAuthenticationViewModel
@{
2018-04-19 15:57:23 -05:00
ViewData.SetActivePageAndTitle(ManageNavPages.TwoFactorAuthentication, "Two-factor authentication");
2017-09-13 15:47:34 +09:00
}
2017-10-27 17:53:04 +09:00
@if(Model.Is2faEnabled)
2017-09-13 15:47:34 +09:00
{
2017-10-27 17:53:04 +09:00
if(Model.RecoveryCodesLeft == 0)
2017-09-13 15:47:34 +09:00
{
<div class="alert alert-danger">
2020-07-08 19:19:29 +02:00
<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>
2017-09-13 15:47:34 +09:00
</div>
}
2017-10-27 17:53:04 +09:00
else if(Model.RecoveryCodesLeft == 1)
2017-09-13 15:47:34 +09:00
{
<div class="alert alert-danger">
2020-07-08 19:19:29 +02:00
<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>
2017-09-13 15:47:34 +09:00
</div>
}
2017-10-27 17:53:04 +09:00
else if(Model.RecoveryCodesLeft <= 3)
2017-09-13 15:47:34 +09:00
{
<div class="alert alert-warning">
2020-07-08 19:19:29 +02:00
<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>
2017-09-13 15:47:34 +09:00
</div>
}
2020-07-08 19:19:29 +02:00
<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>
2017-09-13 15:47:34 +09:00
}
2019-08-29 00:16:16 -07:00
<h5 class="mt-4">Authenticator app</h5>
2020-07-08 19:19:29 +02:00
<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>
2017-09-13 15:47:34 +09:00
@section Scripts {
@await Html.PartialAsync("_ValidationScriptsPartial")
}