Fix browser autocomplete issues

This commit is contained in:
yflory 2023-12-12 16:22:26 +01:00
parent 3a5b66e5d9
commit 7c85728e07
5 changed files with 13 additions and 6 deletions

View File

@ -39,6 +39,7 @@ define([
type: 'password', type: 'password',
'name': 'password', 'name': 'password',
placeholder: Msg.login_password, placeholder: Msg.login_password,
autocomplete: "current-password"
}), }),
]), ]),
]), ]),

View File

@ -79,6 +79,7 @@ define([
h('input.form-control#password', { h('input.form-control#password', {
type: 'password', type: 'password',
placeholder: Msg.login_password, placeholder: Msg.login_password,
autocomplete: "new-password"
}), }),
]), ]),
h('div.input-container', [ h('div.input-container', [
@ -86,6 +87,7 @@ define([
h('input.form-control#password-confirm', { h('input.form-control#password-confirm', {
type: 'password', type: 'password',
placeholder: Msg.login_confirm, placeholder: Msg.login_confirm,
autocomplete: "new-password"
}), }),
]), ]),
]), ]),

View File

@ -877,7 +877,7 @@ define([
opts = opts || {}; opts = opts || {};
var attributes = merge({ var attributes = merge({
type: 'password', type: 'password',
autocomplete: 'new-password', // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values autocomplete: 'one-time-code', // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values
}, opts); }, opts);
var input = h('input.cp-password-input', attributes); var input = h('input.cp-password-input', attributes);

View File

@ -2527,7 +2527,7 @@ define([
UI.createCheckbox('cp-creation-expire', Messages.creation_expiration, false, { UI.createCheckbox('cp-creation-expire', Messages.creation_expiration, false, {
labelAlt: Messages.creation_expiresIn labelAlt: Messages.creation_expiresIn
}), }),
h('span.cp-creation-expire-picker.cp-creation-slider', [ h('form.cp-creation-expire-picker.cp-creation-slider', { autocomplete: "off" }, [
h('input#cp-creation-expire-val', { h('input#cp-creation-expire-val', {
type: "number", type: "number",
min: 1, min: 1,
@ -2789,7 +2789,7 @@ define([
case "month": unit = 3600 * 24 * 30; break; case "month": unit = 3600 * 24 * 30; break;
default: unit = 0; default: unit = 0;
} }
expireVal = ($('#cp-creation-expire-val').val() || 0) * unit; expireVal = (Math.min(Number($('#cp-creation-expire-val').val()), 100) || 0) * unit;
} }
// Password // Password
var passwordVal = $('#cp-creation-password').is(':checked') ? var passwordVal = $('#cp-creation-password').is(':checked') ?

View File

@ -532,7 +532,8 @@ define([
var form = h('div', [ var form = h('div', [
UI.passwordInput({ UI.passwordInput({
id: 'cp-settings-delete-account', id: 'cp-settings-delete-account',
placeholder: Messages.settings_changePasswordCurrent placeholder: Messages.settings_changePasswordCurrent,
autocomplete: 'current-password',
}, true), }, true),
button button
]); ]);
@ -676,11 +677,13 @@ define([
}, true), }, true),
UI.passwordInput({ UI.passwordInput({
id: 'cp-settings-change-password-new', id: 'cp-settings-change-password-new',
placeholder: Messages.settings_changePasswordNew placeholder: Messages.settings_changePasswordNew,
autocomplete: 'new-password',
}, true), }, true),
UI.passwordInput({ UI.passwordInput({
id: 'cp-settings-change-password-new2', id: 'cp-settings-change-password-new2',
placeholder: Messages.settings_changePasswordNewConfirm placeholder: Messages.settings_changePasswordNewConfirm,
autocomplete: 'new-password',
}, true), }, true),
h('button.btn.btn-primary', Messages.settings_changePasswordButton) h('button.btn.btn-primary', Messages.settings_changePasswordButton)
]); ]);
@ -939,6 +942,7 @@ define([
pwInput = h('input#cp-mfa-password', { pwInput = h('input#cp-mfa-password', {
type: 'password', type: 'password',
placeholder: Messages.login_password, placeholder: Messages.login_password,
autocomplete: 'current-password',
}), }),
button button
]); ]);