Repository navigation
Fix saving passwords changed without a keydown event - #3347
Conversation
|
I do not understand either why the keydown event was an additional condition. Actually, if we pre-fill the fields with |
Good point, so we can just use something like: if ($('#adminPasswordEntry').val() !== '*****') {which is much cleaner. I am not sure why all those conditions were needed in the past. Maybe they were there to avoid submitting empty password fields. But now that the admin and surveillance user passwords are required, those extra conditions can be removed AFAICS. |
|
Even a change + keydown event does not assure the field is not empty. I mean making it empty requires a change and a keydown (assuming no password manager can enter an empty password). Maybe the conditions were incrementally appended ... yeah, see here: 818cd28 So the keydown condition was explicitly added to prevent saving autofilled password, not considering password managers, but browser autocompletion features which sometimes touch all input fields without actually changing the content. The failsafe "addition" of checking This also explains why there was/is another |
Password fields are pre-filled with ***** when unchanged, so the frontend can use that placeholder as the condition for whether to send a password value. This avoids relying on keydown/change tracking, which can miss values entered by password managers, autofill, or context-menu paste.
bd9732c to
13012b5
Compare
|
Good find!
If there are still any such checks in the backend, could you please point me to them? |
MichaIng
left a comment
There was a problem hiding this comment.
Great when a bug can be fixed by removing and simplifying code 👍🙂
It is not there anymore. I just remember this popped up in a PR, maybe got removed, or maybe someone wanted to add it in the backend. I just remember that I verified the frontend does the |
Fix passwords not being sent to the backend when changed without a
keydownevent.This fixes an issue where passwords entered through a password manager, browser autofill, or right-click paste could appear to be accepted in the UI but were not actually saved after clicking Apply.
Those input methods can trigger a
changeevent without triggeringkeydown. The frontend previously required both events before including password fields in the config payload, so the Apply request could be sent without the updated passwords.Issue: #3345