refactor(EnvelopeLocked): Umbenennung von Expiration in SmsExpiration.

- HomeController aktualisiert.
This commit is contained in:
Developer 02 2024-12-11 18:00:48 +01:00
parent e82d7552c2
commit 72a0cb78c7
2 changed files with 5 additions and 5 deletions

View File

@ -193,9 +193,9 @@ namespace EnvelopeGenerator.Web.Controllers
{ {
var res = await _msgService.SendSmsCodeAsync(er_secret.PhoneNumber!, envelopeReceiverId: envelopeReceiverId); var res = await _msgService.SendSmsCodeAsync(er_secret.PhoneNumber!, envelopeReceiverId: envelopeReceiverId);
if (res.Ok) if (res.Ok)
return View("EnvelopeLocked").WithData("CodeType", "smsCode").WithData("Expiration", res.Expiration); return View("EnvelopeLocked").WithData("CodeType", "smsCode").WithData("SmsExpiration", res.Expiration);
else if (!res.Allowed) else if (!res.Allowed)
return View("EnvelopeLocked").WithData("CodeType", "smsCode").WithData("Expiration", res.AllowedAt); return View("EnvelopeLocked").WithData("CodeType", "smsCode").WithData("SmsExpiration", res.AllowedAt);
else else
{ {
var res_json = JsonConvert.SerializeObject(res); var res_json = JsonConvert.SerializeObject(res);

View File

@ -12,7 +12,7 @@
bool viaSms = codeType == "smsCode"; bool viaSms = codeType == "smsCode";
bool viaAuthenticator = codeType == "authenticatorCode"; bool viaAuthenticator = codeType == "authenticatorCode";
bool viaTFA = viaSms || viaAuthenticator; bool viaTFA = viaSms || viaAuthenticator;
DateTime? expiration = ViewData["Expiration"] is DateTime _expiration ? _expiration : null; DateTime? smsExpiration = ViewData["SmsExpiration"] is DateTime _smsExpiration ? _smsExpiration : null;
bool tfaEnabled = ViewData["TFAEnabled"] is bool _tfaEnabled && _tfaEnabled; bool tfaEnabled = ViewData["TFAEnabled"] is bool _tfaEnabled && _tfaEnabled;
bool hasPhoneNumber = ViewData["HasPhoneNumber"] is bool _hasPhoneNumber && _hasPhoneNumber; bool hasPhoneNumber = ViewData["HasPhoneNumber"] is bool _hasPhoneNumber && _hasPhoneNumber;
} }
@ -58,7 +58,7 @@
<label class="form-check-label" for="flexSwitchCheckChecked">2FA per SMS</label> <label class="form-check-label" for="flexSwitchCheckChecked">2FA per SMS</label>
</div> </div>
} }
@if (expiration is not null) @if (smsExpiration is not null)
{ {
<div id="sms-timer" class="alert alert-primary" role="alert">00:00</div> <div id="sms-timer" class="alert alert-primary" role="alert">00:00</div>
} }
@ -81,7 +81,7 @@
</section> </section>
</div> </div>
<script nonce="@nonce"> <script nonce="@nonce">
var expiration = new Date(@Html.Raw(JsonConvert.SerializeObject(expiration))); var expiration = new Date(@Html.Raw(JsonConvert.SerializeObject(smsExpiration)));
const element = document.getElementById("sms-timer"); const element = document.getElementById("sms-timer");