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',
'name': 'password',
placeholder: Msg.login_password,
autocomplete: "current-password"
}),
]),
]),

View File

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

View File

@ -877,7 +877,7 @@ define([
opts = opts || {};
var attributes = merge({
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);
var input = h('input.cp-password-input', attributes);

View File

@ -2527,7 +2527,7 @@ define([
UI.createCheckbox('cp-creation-expire', Messages.creation_expiration, false, {
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', {
type: "number",
min: 1,
@ -2789,7 +2789,7 @@ define([
case "month": unit = 3600 * 24 * 30; break;
default: unit = 0;
}
expireVal = ($('#cp-creation-expire-val').val() || 0) * unit;
expireVal = (Math.min(Number($('#cp-creation-expire-val').val()), 100) || 0) * unit;
}
// Password
var passwordVal = $('#cp-creation-password').is(':checked') ?

View File

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