This commit is contained in:
Daniel Balk
2023-04-03 04:07:57 +02:00
parent ddaba17c43
commit 5f6631dd1d
2 changed files with 20 additions and 7 deletions

View File

@@ -176,12 +176,22 @@
</div>
<div class="modal-body scroll-y pt-10 pb-15 px-lg-17">
<div class="text-gray-500 fw-semibold fs-6 mb-10">
To finish activating, enter the current TOTP code <br/>
<input type="text" class="form-control form-control-lg form-control-solid" @bind="currentTotp"/>
<div class="alert alert-primary d-flex align-items-center p-5 mb-10">
<i class="bx bx-info-circle fs-2hx text-primary me-4">
<span class="path1"></span><span class="path2"></span>
</i>
<div class="d-flex flex-column">
<h4 class="mb-1 text-primary">
<TL>2fa Code requiered</TL>
</h4>
<span>In order to finish the activation of 2fa, you need to enter the code your 2fa app shows you.</span>
</div>
</div>
<input type="text" class="form-control form-control-lg form-control-solid" placeholder="@SmartTranslateService.Translate("2fa Code")" @bind="currentTotp"/>
<br/>
<WButton CssClasses="btn btn-primary px-6 align-self-center text-nowrap float end" WorkingText="@SmartTranslateService.Translate("Saving")" Text="@SmartTranslateService.Translate("Save")" OnClick="CheckAndSaveTotp">
<WButton CssClasses="btn btn-primary px-6 align-self-center text-nowrap float-end" WorkingText="@SmartTranslateService.Translate("Saving")" Text="@SmartTranslateService.Translate("Finish")" OnClick="CheckAndSaveTotp">
</WButton>
</div>
</div>
@@ -239,9 +249,10 @@
if (await TotpService.Verify(TotpSecret, currentTotp))
{
await TotpService.EnforceTotpLogin();
TotpEnabled = await TotpService.GetEnabled();
TotpEnabled = true;
TotpSecret = await TotpService.GetSecret();
await ToastService.Success("Successfully enabled 2fa!");
StateHasChanged();
}
else
{

View File

@@ -426,3 +426,5 @@ anyone write a fancy text here?;anyone write a fancy text here?
Disable;Disable
You need to enter a 2fa code;You need to enter a 2fa code
2FA code invalid;2FA code invalid
2fa Code;2fa Code
2fa Code requiered;2fa Code requiered