Add check for form

This commit is contained in:
varjolintu 2021-03-13 14:16:04 +02:00
parent 7fcfc82a04
commit a27154ad47

View file

@ -388,6 +388,10 @@ kpxcFields.getAllCombinations = async function(inputs) {
// Adds segmented TOTP fields to the combination if found
kpxcFields.getSegmentedTOTPFields = function(inputs, combinations) {
const form = inputs.length > 0 ? inputs[0].form : undefined;
if (!form) {
return combinations;
}
if (acceptedOTPFields.some(f => form.className.includes(f) || form.id.includes(f) || form.name.includes(f))
|| form.length === 6) {
const totpInputs = Array.from(form.elements).filter(e => e.nodeName === 'INPUT' && e.type !== 'password');