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:
Peter Keresztes Schmidt
2020-06-09 23:00:21 +02:00
committed by Florence Blanc-Renaud
parent 3ecea7800a
commit 13b177822e
3 changed files with 20 additions and 18 deletions

View File

@@ -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'
});

View File

@@ -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
}
];