2020-05-24 02:12:11 +01:00
|
|
|
@page
|
|
|
|
|
@model TwoFactorAuthenticationModel
|
|
|
|
|
@{
|
|
|
|
|
ViewData["Title"] = "Two-factor authentication (2FA)";
|
|
|
|
|
ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication;
|
|
|
|
|
}
|
2020-12-20 21:34:13 +00:00
|
|
|
<partial for="StatusMessage" name="_StatusMessage" />
|
2020-05-24 02:12:11 +01:00
|
|
|
<h4>@ViewData["Title"]</h4>
|
2020-12-20 21:34:13 +00:00
|
|
|
@if(Model.Is2faEnabled)
|
2020-05-24 02:12:11 +01:00
|
|
|
{
|
2020-12-20 21:34:13 +00:00
|
|
|
if(Model.RecoveryCodesLeft == 0)
|
2020-05-24 02:12:11 +01:00
|
|
|
{
|
|
|
|
|
<div class="alert alert-danger">
|
|
|
|
|
<strong>You have no recovery codes left.</strong>
|
|
|
|
|
<p>
|
|
|
|
|
You must
|
|
|
|
|
<a asp-page="./GenerateRecoveryCodes">generate a new set of recovery codes</a> before you can log in with a recovery code.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
2020-12-20 21:34:13 +00:00
|
|
|
else if(Model.RecoveryCodesLeft == 1)
|
2020-05-24 02:12:11 +01:00
|
|
|
{
|
|
|
|
|
<div class="alert alert-danger">
|
|
|
|
|
<strong>You have 1 recovery code left.</strong>
|
|
|
|
|
<p>
|
|
|
|
|
You can
|
|
|
|
|
<a asp-page="./GenerateRecoveryCodes">generate a new set of recovery codes</a>.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
2020-12-20 21:34:13 +00:00
|
|
|
else if(Model.RecoveryCodesLeft <= 3)
|
2020-05-24 02:12:11 +01:00
|
|
|
{
|
|
|
|
|
<div class="alert alert-warning">
|
|
|
|
|
<strong>You have @Model.RecoveryCodesLeft recovery codes left.</strong>
|
|
|
|
|
<p>
|
|
|
|
|
You should
|
|
|
|
|
<a asp-page="./GenerateRecoveryCodes">generate a new set of recovery codes</a>.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-20 21:34:13 +00:00
|
|
|
if(Model.IsMachineRemembered)
|
2020-05-24 02:12:11 +01:00
|
|
|
{
|
|
|
|
|
<form method="post" style="display: inline-block">
|
|
|
|
|
<button class="btn btn-default" type="submit">Forget this browser</button>
|
|
|
|
|
</form>
|
|
|
|
|
}
|
2020-12-20 21:34:13 +00:00
|
|
|
<a asp-page="./Disable2fa" class="btn btn-default">Disable 2FA</a>
|
|
|
|
|
<a asp-page="./GenerateRecoveryCodes" class="btn btn-default">Reset recovery codes</a>}
|
2020-05-24 02:12:11 +01:00
|
|
|
<h5>Authenticator app</h5>
|
2020-12-20 21:34:13 +00:00
|
|
|
@if(!Model.HasAuthenticator)
|
2020-05-24 02:12:11 +01:00
|
|
|
{
|
2020-12-20 21:34:13 +00:00
|
|
|
<a asp-page="./EnableAuthenticator" class="btn btn-default" id="enable-authenticator">Add authenticator app</a>}
|
2020-05-24 02:12:11 +01:00
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<a asp-page="./EnableAuthenticator" class="btn btn-default" id="enable-authenticator">Setup authenticator app</a>
|
2020-12-20 21:34:13 +00:00
|
|
|
<a asp-page="./ResetAuthenticator" class="btn btn-default" id="reset-authenticator">Reset authenticator app</a>}
|
2020-05-24 02:12:11 +01:00
|
|
|
|
|
|
|
|
@section Scripts {
|
|
|
|
|
<partial name="_ValidationScriptsPartial" />
|
|
|
|
|
}
|