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">
<strong>You have no recovery codes left.</strong>
2019-11-15 11:24:27 +01:00
<p>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">
<strong>You have 1 recovery code left.</strong>
2019-11-15 11:24:27 +01:00
<p>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">
<strong>You have @Model.RecoveryCodesLeft recovery codes left.</strong>
2019-11-15 11:24:27 +01:00
<p>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>
}
2018-04-07 23:49:36 -05:00
<a asp-action="Disable2faWarning" class="btn btn-primary">Disable 2FA</a>
<a asp-action="GenerateRecoveryCodes" class="btn btn-primary">Reset recovery codes</a>
2017-09-13 15:47:34 +09:00
}
2019-08-29 00:16:16 -07:00
<h5 class="mt-4">Authenticator app</h5>
2017-10-27 17:53:04 +09:00
@if(!Model.HasAuthenticator)
2017-09-13 15:47:34 +09:00
{
2018-04-07 23:49:36 -05:00
<a asp-action="EnableAuthenticator" class="btn btn-primary">Add authenticator app</a>
2017-09-13 15:47:34 +09:00
}
else
{
2018-04-07 23:49:36 -05:00
<a asp-action="EnableAuthenticator" class="btn btn-primary">Configure authenticator app</a>
<a asp-action="ResetAuthenticatorWarning" class="btn btn-primary">Reset authenticator key</a>
2017-09-13 15:47:34 +09:00
}
@section Scripts {
@await Html.PartialAsync("_ValidationScriptsPartial")
}