feat(Reg.cshtml): Zeitüberschreitung hinzugefügt.

- TFARegController.Reg aktualisiert, um die Seite _Expired view zu senden, wenn receiver.TfaRegDeadline abläuft.
 - TFARegParams Klasse für TimeLimit Configuration erstellt und mit appsettings konfiguriert.
This commit is contained in:
Developer 02
2025-02-06 17:59:19 +01:00
parent 3e6e2078bb
commit 1720e137f9
8 changed files with 71 additions and 4 deletions

View File

@@ -42,7 +42,7 @@
</a>
um Ihre Authenticator-App einzurichten.
</p>
</section>
</section>
}
<section class="text-center">
<p>@_localizer[WebKey.Formats.LockedBody.Format(codeKeyName)].Value.Format(qrCodeExpiration.ToString())</p>

View File

@@ -0,0 +1,25 @@
@{
ViewData["Title"] = "Abgelaufen";
var head = ViewData["Head"] as string ?? "Abgelaufen!";
var body = ViewData["Body"] as string ?? "Die Gültigkeitsdauer der Verbindung ist abgelaufen.";
}
<div class="page container p-5">
<header class="text-center">
<div class="icon expired">
<svg width="72" height="72" viewBox="0 0 48 48" version="1" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 48 48">
<circle fill="#00ACC1" cx="17" cy="17" r="14" />
<circle fill="#eee" cx="17" cy="17" r="11" />
<rect x="16" y="8" width="2" height="9" />
<rect x="18.2" y="16" transform="matrix(-.707 .707 -.707 -.707 46.834 19.399)" width="2.4" height="6.8" />
<circle cx="17" cy="17" r="2" />
<circle fill="#00ACC1" cx="17" cy="17" r="1" />
<path fill="#FFC107" d="M11.9,42l14.4-24.1c0.8-1.3,2.7-1.3,3.4,0L44.1,42c0.8,1.3-0.2,3-1.7,3H13.6C12.1,45,11.1,43.3,11.9,42z" />
<path fill="#263238" d="M26.4,39.9c0-0.2,0-0.4,0.1-0.6s0.2-0.3,0.3-0.5s0.3-0.2,0.5-0.3s0.4-0.1,0.6-0.1s0.5,0,0.7,0.1 s0.4,0.2,0.5,0.3s0.2,0.3,0.3,0.5s0.1,0.4,0.1,0.6s0,0.4-0.1,0.6s-0.2,0.3-0.3,0.5s-0.3,0.2-0.5,0.3s-0.4,0.1-0.7,0.1 s-0.5,0-0.6-0.1s-0.4-0.2-0.5-0.3s-0.2-0.3-0.3-0.5S26.4,40.1,26.4,39.9z M29.2,36.8h-2.3L26.5,27h3L29.2,36.8z" />
</svg>
</div>
<h1>@head</h1>
</header>
<section class="text-center">
<p>@body</p>
</section>
</div>

View File

@@ -1,6 +1,8 @@
@{
@using System.Globalization
@{
ViewData["Title"] = "2FA Registrierung";
var totpQR64 = ViewData["TotpQR64"] as string;
var regDeadline = ViewData["RegDeadline"] is DateTime _dateTime ? _dateTime : throw new InvalidOperationException("RegDeadline is not added to view in Reg.cshtml view.");
}
<div class="page container p-5">
<header class="text-center">
@@ -13,6 +15,9 @@
<h2 class="mb-0">2-Factor Authentication (2FA)</h2>
<h2>Registrierung</h2>
</header>
<section class="text-center">
<p class="p-0 m-0"> @string.Format("Diese Seite ist bis {0} sichtbar.", regDeadline.ToString("d. MMM, HH:mm", new CultureInfo("de-DE")))</p>
</section>
<section class="text-start mt-4">
<div class="accordion" id="tfaRegStep">
<div class="accordion-item">