2FA setup usability improvements:

* focus OTP fields when prompting the user
* 'submit' account password and OTPs on enter keyup
This commit is contained in:
ansuz 2023-07-22 13:45:06 +05:30
parent 315f505833
commit 601a15e848
1 changed files with 21 additions and 0 deletions

View File

@ -938,6 +938,11 @@ define([
]);
$content.append(pwContainer);
// submit password on enter keyup
$(pwInput).on('keyup', e => {
if (e.which === 13) { $mfaRevokeBtn.click(); }
});
var spinner = UI.makeSpinner($mfaRevokeBtn);
$mfaRevokeBtn.click(function () {
var name = privateData.accountName;
@ -1004,6 +1009,11 @@ define([
}, {raw: true});
});
OTPEntry.focus();
// submit OTP on enter keyup
$OTPEntry.on('keyup', e => {
if (e.which === 13) { $d.click(); }
});
});
});
@ -1023,6 +1033,12 @@ define([
button
]));
var spinner = UI.makeSpinner($mfaSetupBtn);
// submit password on enter keyup
$(pwInput).on('keyup', e => {
if (e.which === 13) { $(button).click(); }
});
$(button).click(function () {
var name = privateData.accountName;
var password = $(pwInput).val();
@ -1175,6 +1191,11 @@ define([
])
])
]);
OTPEntry.focus();
// submit OTP on enter keyup
$OTPEntry.on('keyup', e => {
if (e.which === 13) { $(confirmOTP).click(); }
});
};