mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-19 05:33:31 +01:00
Merge pull request #3519 from dennisreimann/2fa-layout
Use simple layout for 2FA views
This commit is contained in:
commit
fe782bc3b6
@ -1,5 +1,6 @@
|
||||
@{
|
||||
Layout = "_LayoutSimple";
|
||||
ViewBag.ShowTitle ??= true;
|
||||
ViewBag.ShowLeadText ??= false;
|
||||
}
|
||||
|
||||
@ -45,7 +46,10 @@
|
||||
</div>
|
||||
|
||||
<div class="account-form">
|
||||
<h4>@ViewData["Title"]</h4>
|
||||
@if (ViewBag.ShowTitle)
|
||||
{
|
||||
<h4>@ViewData["Title"]</h4>
|
||||
}
|
||||
@RenderBody()
|
||||
</div>
|
||||
|
||||
|
@ -1,17 +1,13 @@
|
||||
@model LoginWith2faViewModel
|
||||
|
||||
<div class="row pt-5">
|
||||
<div class="col-lg-12 section-heading">
|
||||
<h2>Two-factor authentication</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<form class="col-12" method="post" asp-route-returnUrl="@ViewData["ReturnUrl"]" asp-action="LoginWith2fa">
|
||||
<div class="twoFaBox">
|
||||
<h2 class="h3 mb-3">Two-factor authentication</h2>
|
||||
<form method="post" asp-route-returnUrl="@ViewData["ReturnUrl"]" asp-action="LoginWith2fa">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<input asp-for="RememberMe" type="hidden"/>
|
||||
<div class="form-group">
|
||||
<label asp-for="TwoFactorCode" class="form-label"></label>
|
||||
<input asp-for="TwoFactorCode" class="form-control" autocomplete="off" autofocus style="width:13em" />
|
||||
<input asp-for="TwoFactorCode" class="form-control" autocomplete="off" autofocus style="width:13em"/>
|
||||
<span asp-validation-for="TwoFactorCode" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@ -26,13 +22,9 @@
|
||||
<button type="submit" class="btn btn-primary">Log in</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="text-secondary">
|
||||
Don't have access to your authenticator device?
|
||||
<br>
|
||||
You can <a asp-action="LoginWithRecoveryCode" asp-route-returnUrl="@ViewData["ReturnUrl"]">log in with a recovery code</a>.
|
||||
</p>
|
||||
</div>
|
||||
<p class="text-secondary mt-4 mb-0">
|
||||
Don't have access to your authenticator device?
|
||||
<br>
|
||||
You can <a asp-action="LoginWithRecoveryCode" asp-route-returnUrl="@ViewData["ReturnUrl"]">log in with a recovery code</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
@ -1,32 +1,31 @@
|
||||
@model BTCPayServer.Fido2.Models.LoginWithFido2ViewModel
|
||||
|
||||
<form id="fidoForm" asp-action="LoginWithFido2" method="post" asp-route-returnUrl="@ViewData["ReturnUrl"]">
|
||||
<input type="hidden" asp-for="Data"/>
|
||||
<input type="hidden" asp-for="Response"/>
|
||||
<input type="hidden" asp-for="UserId"/>
|
||||
<input type="hidden" asp-for="RememberMe"/>
|
||||
</form>
|
||||
|
||||
<div class="row pt-5">
|
||||
<div class="col-lg-12 section-heading">
|
||||
<h2>FIDO2 Authentication</h2>
|
||||
<p>Insert your security device and proceed.</p>
|
||||
<div id="info-message" class="alert alert-info mb-3 d-none">
|
||||
<div class="d-flex align-items-center">
|
||||
<span id="spinner" class="fa fa-spinner fa-spin me-3 mt-1 fido-running" style="font-size:1.5rem"></span>
|
||||
<span>If your security device has a button, tap on it.</span>
|
||||
</div>
|
||||
<div class="twoFaBox">
|
||||
<form id="fidoForm" asp-action="LoginWithFido2" method="post" asp-route-returnUrl="@ViewData["ReturnUrl"]">
|
||||
<input type="hidden" asp-for="Data"/>
|
||||
<input type="hidden" asp-for="Response"/>
|
||||
<input type="hidden" asp-for="UserId"/>
|
||||
<input type="hidden" asp-for="RememberMe"/>
|
||||
</form>
|
||||
<h2 class="h3 mb-3">FIDO2 Authentication</h2>
|
||||
<p>Insert your security device and proceed.</p>
|
||||
<div id="info-message" class="alert alert-info mb-3 d-none">
|
||||
<div class="d-flex align-items-center">
|
||||
<span id="spinner" class="fa fa-spinner fa-spin me-3 mt-1 fido-running" style="font-size:1.5rem"></span>
|
||||
<span>If your security device has a button, tap on it.</span>
|
||||
</div>
|
||||
<button id="btn-start" class="btn btn-primary d-none" type="button">Start</button>
|
||||
<p id="error-message" class="d-none alert alert-danger"></p>
|
||||
<button id="btn-retry" class="btn btn-secondary d-none" type="button">Retry</button>
|
||||
</div>
|
||||
<button id="btn-start" class="btn btn-primary d-none" type="button">Start</button>
|
||||
<p id="error-message" class="d-none alert alert-danger"></p>
|
||||
<button id="btn-retry" class="btn btn-secondary d-none" type="button">Retry</button>
|
||||
|
||||
<script>
|
||||
document.getElementById('btn-retry').addEventListener('click', () => window.location.reload())
|
||||
// send to server for registering
|
||||
window.makeAssertionOptions = @Safe.Json(Model.Data);
|
||||
</script>
|
||||
<script src="~/js/webauthn/helpers.js" asp-append-version="true"></script>
|
||||
<script src="~/js/webauthn/login.js" asp-append-version="true"></script>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById('btn-retry').addEventListener('click', () => window.location.reload())
|
||||
// send to server for registering
|
||||
window.makeAssertionOptions = @Safe.Json(Model.Data);
|
||||
</script>
|
||||
<script src="~/js/webauthn/helpers.js" asp-append-version="true"></script>
|
||||
<script src="~/js/webauthn/login.js" asp-append-version="true"></script>
|
||||
|
||||
|
@ -7,50 +7,43 @@
|
||||
};
|
||||
}
|
||||
|
||||
<section class="pt-5" id="lnurlauth-section">
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 section-heading">
|
||||
<h2>LNURL Auth</h2>
|
||||
<div class="align-items-center">
|
||||
<ul class="nav justify-content-center my-2">
|
||||
@for (int i = 0; i < formats.Count; i++)
|
||||
{
|
||||
var mode = formats.ElementAt(i);
|
||||
<li class="nav-item">
|
||||
<a class="btcpay-pill @(i == 0 ? "active" : "")"
|
||||
data-bs-toggle="tab" data-bs-target="#@mode.Key" role="tab"
|
||||
href="#">
|
||||
@mode.Key
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
@for (int i = 0; i < formats.Count; i++)
|
||||
{
|
||||
var mode = formats.ElementAt(i);
|
||||
<div class="tab-pane text-center @(i == 0 ? "active" : "")" id="@mode.Key" role="tabpanel">
|
||||
<div class="qr-container" style="min-height: 256px;">
|
||||
<vc:qr-code data="@mode.Value"></vc:qr-code>
|
||||
</div>
|
||||
<a href="@mode.Value" class="btn btn-primary mt-3" rel="noreferrer noopener">
|
||||
Open in wallet
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
<div id="lnurlauth-section" class="twoFaBox">
|
||||
<form id="authform" asp-action="LoginWithLNURLAuth" method="post" asp-route-returnUrl="@ViewData["ReturnUrl"]">
|
||||
<input type="hidden" asp-for="LNURLEndpoint"/>
|
||||
<input type="hidden" asp-for="UserId"/>
|
||||
</form>
|
||||
<h2 class="h3 mb-3">LNURL Auth</h2>
|
||||
<div class="align-items-center">
|
||||
<ul class="nav justify-content-center my-2">
|
||||
@for (int i = 0; i < formats.Count; i++)
|
||||
{
|
||||
var mode = formats.ElementAt(i);
|
||||
<li class="nav-item">
|
||||
<a class="btcpay-pill @(i == 0 ? "active" : "")"
|
||||
data-bs-toggle="tab" data-bs-target="#@mode.Key" role="tab"
|
||||
href="#">
|
||||
@mode.Key
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
@for (int i = 0; i < formats.Count; i++)
|
||||
{
|
||||
var mode = formats.ElementAt(i);
|
||||
<div class="tab-pane text-center @(i == 0 ? "active" : "")" id="@mode.Key" role="tabpanel">
|
||||
<div class="qr-container" style="min-height: 256px;">
|
||||
<vc:qr-code data="@mode.Value"></vc:qr-code>
|
||||
</div>
|
||||
<p>Scan the QR code with your lightning wallet and link to your user account.</p>
|
||||
<a href="@mode.Value" class="btn btn-primary mt-3" rel="noreferrer noopener">
|
||||
Open in wallet
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<p>Scan the QR code with your lightning wallet and link to your user account.</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<form id="authform" asp-action="LoginWithLNURLAuth" method="post" asp-route-returnUrl="@ViewData["ReturnUrl"]">
|
||||
<input type="hidden" asp-for="LNURLEndpoint"/>
|
||||
<input type="hidden" asp-for="UserId"/>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function check() {
|
||||
|
@ -1,29 +1,21 @@
|
||||
@model LoginWithRecoveryCodeViewModel
|
||||
@{
|
||||
Layout = "_LayoutSignedOut";
|
||||
ViewData["Title"] = "Recovery code verification";
|
||||
}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12 section-heading">
|
||||
<h2>@ViewData["Title"]</h2>
|
||||
<hr class="primary">
|
||||
<p>
|
||||
You have requested to login with a recovery code. This login will not be remembered until you provide
|
||||
an authenticator app code at login or disable 2FA and login again.
|
||||
</p>
|
||||
<p>
|
||||
You have requested to login with a recovery code. This login will not be remembered until you provide
|
||||
an authenticator app code at login or disable 2FA and login again.
|
||||
</p>
|
||||
<form method="post">
|
||||
<div class="form-group">
|
||||
<label asp-for="RecoveryCode" class="form-label"></label>
|
||||
<input asp-for="RecoveryCode" class="form-control" autocomplete="off" />
|
||||
<span asp-validation-for="RecoveryCode" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<form method="post" class="col-12">
|
||||
<div asp-validation-summary="All" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="RecoveryCode" class="form-label"></label>
|
||||
<input asp-for="RecoveryCode" class="form-control" autocomplete="off" />
|
||||
<span asp-validation-for="RecoveryCode" class="text-danger"></span>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Log in</button>
|
||||
</form>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Log in</button>
|
||||
</form>
|
||||
|
||||
@section PageFootContent {
|
||||
<partial name="_ValidationScriptsPartial" />
|
||||
|
@ -1,6 +1,16 @@
|
||||
@model SecondaryLoginViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Two-factor/U2F authentication";
|
||||
Layout = "_LayoutSignedOut";
|
||||
ViewBag.ShowTitle = false;
|
||||
}
|
||||
|
||||
@section PageHeadContent {
|
||||
<style>.twoFaBox + .twoFaBox { margin-top: var(--btcpay-space-l); padding-top: var(--btcpay-space-l); border-top: 1px solid var(--btcpay-body-border-light); }</style>
|
||||
}
|
||||
|
||||
@section PageFootContent {
|
||||
<partial name="_ValidationScriptsPartial" />
|
||||
}
|
||||
|
||||
@if (Model.LoginWith2FaViewModel != null && Model.LoginWithFido2ViewModel != null&& Model.LoginWithLNURLAuthViewModel != null)
|
||||
@ -10,7 +20,7 @@
|
||||
else if (Model.LoginWith2FaViewModel == null && Model.LoginWithFido2ViewModel == null && Model.LoginWithLNURLAuthViewModel == null)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-lg-12 section-heading">
|
||||
<div class="col-lg-12">
|
||||
<h2 class="bg-danger">2FA and U2F/FIDO2 and LNURL-Auth Authentication Methods are not available. Please go to the https endpoint.</h2>
|
||||
<hr class="danger">
|
||||
</div>
|
||||
@ -20,24 +30,14 @@ else if (Model.LoginWith2FaViewModel == null && Model.LoginWithFido2ViewModel ==
|
||||
<div class="row justify-content-center">
|
||||
@if (Model.LoginWith2FaViewModel != null)
|
||||
{
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<partial name="LoginWith2fa" model="@Model.LoginWith2FaViewModel"/>
|
||||
</div>
|
||||
<partial name="LoginWith2fa" model="@Model.LoginWith2FaViewModel"/>
|
||||
}
|
||||
@if (Model.LoginWithFido2ViewModel != null)
|
||||
{
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<partial name="LoginWithFido2" model="@Model.LoginWithFido2ViewModel"/>
|
||||
</div>
|
||||
<partial name="LoginWithFido2" model="@Model.LoginWithFido2ViewModel"/>
|
||||
}
|
||||
@if (Model.LoginWithLNURLAuthViewModel != null)
|
||||
{
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<partial name="LoginWithLNURLAuth" model="@Model.LoginWithLNURLAuthViewModel"/>
|
||||
</div>
|
||||
<partial name="LoginWithLNURLAuth" model="@Model.LoginWithLNURLAuthViewModel"/>
|
||||
}
|
||||
</div>
|
||||
|
||||
@section PageFootContent {
|
||||
<partial name="_ValidationScriptsPartial" />
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user