mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
WebUI: move OTP to be the last field in the PW reset form
Since TOTPs have a limited validity, let the user enter them as the last item in the form. This reduces the chance of the TOTP getting invalid while the user is still filling out other fields. Related: https://pagure.io/freeipa/issue/5628 Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com>
This commit is contained in:
parent
3ecea7800a
commit
13b177822e
@ -776,13 +776,15 @@ IPA.user.password_dialog_pre_op0 = function(spec) {
|
||||
|
||||
IPA.user.password_dialog_pre_op = function(spec) {
|
||||
|
||||
spec.sections[0].fields.splice(0, 0, {
|
||||
spec.sections[0].fields.unshift({
|
||||
name: 'current_password',
|
||||
label: '@i18n:password.current_password',
|
||||
$type: 'password',
|
||||
required: true
|
||||
}, {
|
||||
name: 'otp',
|
||||
});
|
||||
|
||||
spec.sections[0].fields.push({
|
||||
name: 'otp',
|
||||
label: '@i18n:password.otp',
|
||||
$type: 'password'
|
||||
});
|
||||
|
@ -673,17 +673,6 @@ define(['dojo/_base/declare',
|
||||
show_errors: false,
|
||||
undo: false
|
||||
},
|
||||
{
|
||||
name: 'otp',
|
||||
$type: 'password',
|
||||
label: text.get('@i18n:password.otp', "OTP"),
|
||||
placeholder: text.get(
|
||||
'@i18n:password.otp_long',
|
||||
'One-Time-Password'
|
||||
),
|
||||
show_errors: false,
|
||||
undo: false
|
||||
},
|
||||
{
|
||||
name: 'new_password',
|
||||
$type: 'password',
|
||||
@ -717,6 +706,17 @@ define(['dojo/_base/declare',
|
||||
}],
|
||||
show_errors: false,
|
||||
undo: false
|
||||
},
|
||||
{
|
||||
name: 'otp',
|
||||
$type: 'password',
|
||||
label: text.get('@i18n:password.otp', "OTP"),
|
||||
placeholder: text.get(
|
||||
'@i18n:password.otp_long',
|
||||
'One-Time-Password'
|
||||
),
|
||||
show_errors: false,
|
||||
undo: false
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -58,12 +58,12 @@ RESET_AND_LOGIN_FORM = {
|
||||
PKEY, None),
|
||||
('current_password', 'Current Password', False, True, 'password',
|
||||
'current_password', '', 'Current Password'),
|
||||
('otp', 'OTP', False, True, 'password', 'otp', '',
|
||||
'One-Time-Password'),
|
||||
('new_password', 'New Password', True, True, 'password',
|
||||
'new_password', '', 'New Password'),
|
||||
('verify_password', 'Verify Password', True, True, 'password',
|
||||
'verify_password', '', 'New Password'),
|
||||
('otp', 'OTP', False, True, 'password', 'otp', '',
|
||||
'One-Time-Password'),
|
||||
],
|
||||
# structure of buttons
|
||||
# button_name, button_title
|
||||
@ -89,12 +89,12 @@ RESET_PASSWORD_FORM = {
|
||||
'Username'),
|
||||
('current_password', 'Current Password', True, True, 'password',
|
||||
'current_password', '', 'Current Password'),
|
||||
('otp', 'OTP', False, True, 'password', 'otp', '',
|
||||
'One-Time-Password'),
|
||||
('new_password', 'New Password', True, True, 'password',
|
||||
'new_password', '', 'New Password'),
|
||||
('verify_password', 'Verify Password', True, True, 'password',
|
||||
'verify_password', '', 'New Password'),
|
||||
('otp', 'OTP', False, True, 'password', 'otp', '',
|
||||
'One-Time-Password'),
|
||||
],
|
||||
# structure of buttons
|
||||
# button_name, button_title
|
||||
|
Loading…
Reference in New Issue
Block a user