mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
111 lines
3.6 KiB
Plaintext
111 lines
3.6 KiB
Plaintext
@{
|
|
/******************************************************************************
|
|
// Canary Islands Computer Museum Website
|
|
// ----------------------------------------------------------------------------
|
|
//
|
|
// Filename : TwoFactorAuthentication.cshtml
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
//
|
|
// --[ Description ] ----------------------------------------------------------
|
|
//
|
|
// ASP.NET Identify management
|
|
//
|
|
// --[ License ] --------------------------------------------------------------
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as
|
|
// published by the Free Software Foundation, either version 3 of the
|
|
// License, or (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
//
|
|
// ----------------------------------------------------------------------------
|
|
// Copyright © 2003-2018 Natalia Portillo
|
|
*******************************************************************************/
|
|
}
|
|
@page
|
|
@model TwoFactorAuthenticationModel
|
|
@{
|
|
ViewData["Title"] = "Two-factor authentication (2FA)";
|
|
ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication;
|
|
}
|
|
|
|
<partial for="StatusMessage"
|
|
name="_StatusMessage" />
|
|
<h4>@ViewData["Title"]</h4>
|
|
@if(Model.Is2faEnabled)
|
|
{
|
|
if(Model.RecoveryCodesLeft == 0)
|
|
{
|
|
<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>
|
|
}
|
|
else if(Model.RecoveryCodesLeft == 1)
|
|
{
|
|
<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>
|
|
}
|
|
else if(Model.RecoveryCodesLeft <= 3)
|
|
{
|
|
<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>
|
|
}
|
|
|
|
if(Model.IsMachineRemembered)
|
|
{
|
|
<form method="post"
|
|
style="display: inline-block">
|
|
<button class="btn btn-primary"
|
|
type="submit">
|
|
Forget this browser
|
|
</button>
|
|
</form>
|
|
}
|
|
<a asp-page="./Disable2fa"
|
|
class="btn btn-primary">
|
|
Disable 2FA
|
|
</a>
|
|
<a asp-page="./GenerateRecoveryCodes"
|
|
class="btn btn-primary">
|
|
Reset recovery codes
|
|
</a>
|
|
}
|
|
|
|
<h5>Authenticator app</h5>
|
|
@if(!Model.HasAuthenticator)
|
|
{
|
|
<a asp-page="./EnableAuthenticator"
|
|
class="btn btn-primary"
|
|
id="enable-authenticator">
|
|
Add authenticator app
|
|
</a>
|
|
}
|
|
else
|
|
{
|
|
<a asp-page="./EnableAuthenticator"
|
|
class="btn btn-primary"
|
|
id="enable-authenticator">
|
|
Setup authenticator app
|
|
</a>
|
|
<a asp-page="./ResetAuthenticator"
|
|
class="btn btn-primary"
|
|
id="reset-authenticator">
|
|
Reset authenticator app
|
|
</a>
|
|
}
|
|
|
|
@section Scripts {
|
|
<partial name="_ValidationScriptsPartial" />
|
|
} |