Browse Source

Fixed two factor being submitted incorrectly due to enter key. Fixes issue #52

tags/3.0.0
Teknikode 2 years ago
parent
commit
f95dd1f190

+ 6
- 0
Teknik/Areas/User/Scripts/CheckAuthCode.js View File

@@ -2,6 +2,12 @@
$("#authCheckStatus").css('display', 'none', 'important');
$('#Code').focus();

$("#Code").keyup(function (event) {
if (event.keyCode == 13) {
$("#verifyCodeSubmit").click();
}
});

$("#verifyCodeSubmit").click(function () {
setCode = $("#Code").val();
returnUrl = $("#ReturnUrl").val();

+ 20
- 22
Teknik/Areas/User/Views/User/TwoFactorCheck.cshtml View File

@@ -21,28 +21,26 @@
<div id="authCheckStatus"></div>
</div>
</div>
<form role="form" id="twoFactorCheckForm" action="##" method="post" accept-charset="UTF-8">
<input name="ReturnUrl" id="ReturnUrl" type="hidden" value="@Model.ReturnUrl" />
<input name="RememberMe" id="RememberMe" type="hidden" value="@Model.RememberMe" />
<div class="form-group text-left">
<label for="update_website">Authentication code</label>
<input type="text" class="form-control" id="Code" name="Code" data-val-required="The Authentication Code is required." data-val="true" />
</div>
@if (Model.AllowTrustedDevice)
{
<div class="checkbox">
<label>
<input id="RememberDevice" type="checkbox" value="true" name="RememberDevice" /><input name="RememberDevice" type="hidden" value="false"> Remember Device
</label>
</div>
<small>Set this device as a trusted device. It is not advised to trust a public computer.</small>
<br />
<br />
}
<div class="form-group">
<button class="btn btn-primary btn-block" id="verifyCodeSubmit" type="button" name="verifyCodeSubmit">Verify</button>
</div>
</form>
<input name="ReturnUrl" id="ReturnUrl" type="hidden" value="@Model.ReturnUrl" />
<input name="RememberMe" id="RememberMe" type="hidden" value="@Model.RememberMe" />
<div class="form-group text-left">
<label for="update_website">Authentication code</label>
<input type="text" class="form-control" id="Code" name="Code" data-val-required="The Authentication Code is required." data-val="true" />
</div>
@if (Model.AllowTrustedDevice)
{
<div class="checkbox">
<label>
<input id="RememberDevice" type="checkbox" value="true" name="RememberDevice" /><input name="RememberDevice" type="hidden" value="false"> Remember Device
</label>
</div>
<small>Set this device as a trusted device. It is not advised to trust a public computer.</small>
<br />
<br />
}
<div class="form-group">
<button class="btn btn-primary btn-block" id="verifyCodeSubmit" type="button" name="verifyCodeSubmit">Verify</button>
</div>
<p class="text-left">Open the two-factor authentication app on your device to view your authentication code and verify your identity.</p>
</div>
</div>

Loading…
Cancel
Save