Skip to content

Adjust segmented TOTP detection #2387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions keepassxc-browser/content/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ kpxcFields.getSegmentedTOTPFields = function(inputs, combinations) {

let exceptionFound = false;

// Returns true if all 6 inputs are numeric, tel or text/number with maxLength of 1.
// Returns true if all 6 inputs are numeric, tel or text/number with maxLength of 1, or maxLength not defined.
// If ignoreFieldCount is true, number of TOTP fields are allowed to differ from the default (6),
// but 4 at minimum must exist.
const areFieldsSegmentedTotp = function(totpInputs, ignoreFieldCount = false) {
Expand All @@ -106,7 +106,7 @@ kpxcFields.getSegmentedTOTPFields = function(inputs, combinations) {
totpInputs.every(
input =>
((input.inputMode === 'numeric' || input.inputMode === '') && input.pattern.includes('0-9')) ||
((input.type === 'text' || input.type === 'number') && input.maxLength === 1) ||
((input.type === 'text' || input.type === 'number') && (input.maxLength === 1 || input.maxLength === -1)) ||
input.type === 'tel'
)
);
Expand Down