Merge pull request #13606 from conncampbell/12928-OTPLoginFix

fix: OTP login verification fails
This commit is contained in:
gavin 2021-06-30 11:04:18 +05:30 committed by GitHub
commit cceb44a7db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -291,10 +291,18 @@ var verify_token = function (event) {
}
var request_otp = function (r) {
const otp_form_template = '{{ _("Verification") }}<input type="text" id="login_token" autocomplete="off" class="form-control" placeholder={{ _("Verification Code") }} required="" autofocus="">{{ _("Verify") }}';
$('.login-content').empty();
$('.login-content:visible').append(
$('<div>').attr({ 'id': 'twofactor_div' }).html(otp_form_template)
`<div id="twofactor_div">
<form class="form-verify">
<div class="page-card-head">
<span class="indicator blue" data-text="Verification">{{ _("Verification") }}</span>
</div>
<div id="otp_div"></div>
<input type="text" id="login_token" autocomplete="off" class="form-control" placeholder={{ _("Verification Code") }} required="" autofocus="">
<button class="btn btn-sm btn-primary btn-block mt-3" id="verify_token">{{ _("Verify") }}</button>
</form>
</div>`
);
// add event handler for submit button
verify_token();