You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
2FA code input: browser / password manager autofill keeps only the first digit #26608
On the 2FA prompt, browsers and password managers can no longer fill the TOTP code: only the first digit is kept, the 5 other cells stay empty and the user has to type the code by hand. Reported by a user whose password manager filled the code on GLPI 11.0 and no longer does since the upgrade to 12.0.
The segmented code field (templates/twig_components/Mfa/CodeInput.html.twig, #24710) puts autocomplete="one-time-code" on its first cell, but:
autofill writes the whole code into that field and fires an input event, not a paste event. #onInput() in js/modules/Security/MfaCodeInput.js keeps value.replace(/\D/g, '').slice(0, 1), so 5 digits out of 6 are dropped. Only a real clipboard paste (#onPaste()) spreads the digits over the cells;
the first cell has maxlength="1", so password managers that "type" the code key by key into the one-time-code field are blocked after the first digit.
Expected: a code filled in the one-time-code cell is spread over the 6 cells, as on paste.
Page URL
/MFA/Prompt (same component in /MFA/Setup and in the password form)
Steps To reproduce
Enable TOTP on a user.
Log out, log in again to reach /MFA/Prompt.
Let the browser / password manager fill the TOTP code. Without a password manager, run in the console:
Activity