From bfb87dbd15102e095502bdce84fb6dc0fe5589c3 Mon Sep 17 00:00:00 2001 From: Perry Trinh Date: Sat, 20 Apr 2019 18:17:39 -0700 Subject: [PATCH] Added limit to length of password when autofilling if max password length exists (#918) --- src/services/autofill.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/autofill.service.ts b/src/services/autofill.service.ts index d756fc97e74..95e1a00677f 100644 --- a/src/services/autofill.service.ts +++ b/src/services/autofill.service.ts @@ -392,7 +392,8 @@ export default class AutofillService implements AutofillServiceInterface { filledFields[p.opid] = p; fillScript.script.push(['click_on_opid', p.opid]); fillScript.script.push(['focus_by_opid', p.opid]); - fillScript.script.push(['fill_by_opid', p.opid, login.password]); + const passwordLength: number = p.maxLength && p.maxLength > 0 ? p.maxLength : login.password.length; + fillScript.script.push(['fill_by_opid', p.opid, login.password.substring(0, passwordLength)]); }); fillScript = this.setFillScriptForFocus(filledFields, fillScript);