Subject: [pgAdmin][RM4310] User can not connect to the Master Password with Enter button

From: Aditya Toshniwal <[email-masked]>
Date: Wed, 5 Jun 2019 12:43:37 +0530

Hi Hackers,

Attached is the patch to fix an issue where using browser autofills in
alertify dialogs triggers the help page button (#4317).
A workaround was added to master password dialog to avoid this, but that in
turn disabled the 'OK' button tigger on pressing enter button. This is also
fixed with this patch.(#4310)

-- 
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"

---

From: Dave Page <[email-masked]>
Date: Wed, 5 Jun 2019 12:18:03 +0100

Hi

On Wed, Jun 5, 2019 at 8:14 AM Aditya Toshniwal <
[email-masked]> wrote:

> A workaround was added to master password dialog to avoid this, but that
> in turn disabled the 'OK' button tigger on pressing enter button. This is
> also fixed with this patch.(#4310)
>

This isn't quite right. When the browser auto-fills the password, the OK
button remains disabled. I can hit enter though - however, I shouldn't be
able to do that when the OK button is disabled (being the default button on
the dialogue, it should respond to enter, unless another control which also
accepts enter has focus (e.g. a multiline text area).

The OK button should be enabled - probably all the time, as the user could
have entered a blank password, and most systems won't prevent a user from
trying to use such a password.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

---

From: Aditya Toshniwal <[email-masked]>
Date: Wed, 5 Jun 2019 18:09:15 +0530

Hi,

> accepts enter has focus (e.g. a multiline text area).
The autofilled password appears as set, but it is actually not set to
textbox unless you enter/click in the dropdown. We get the DOM element
value as blank even if it appears filled. This is how chromium autofill
behaves. Upon hitting enter the autofill value is set to the textbox and OK
button is enabled.

> trying to use such a password.
I have made the changes to allow blank master password, plus enabling OK
button always. Attached is the updated patch.

---

From: Dave Page <[email-masked]>
Date: Mon, 10 Jun 2019 10:04:27 +0100

Hi

On Wed, Jun 5, 2019 at 1:39 PM Aditya Toshniwal <
[email-masked]> wrote:

>> The OK button should be enabled - probably all the time, as the user
>> could have entered a blank password, and most systems won't prevent a user
>> from trying to use such a password.
>>

I think you've slightly mis-understood what I was trying to say.

- We should not allow a blank password.
- We should not disable the OK button at all.

My analogy was focussed on the fact that most systems never disable OK
buttons on login dialogues, as some of those systems (but not all of
course) may allow blank passwords.

---

From: Aditya Toshniwal <[email-masked]>
Date: Mon, 10 Jun 2019 15:05:14 +0530

Hi,

On Mon, Jun 10, 2019 at 2:34 PM Dave Page <[email-masked]> wrote:

>>>> A workaround was added to master password dialog to avoid this, but
>>>> that in turn disabled the 'OK' button tigger on pressing enter button. This
>>>> is also fixed with this patch.(#4310)
>>>>
>>>
Got it !! Attached is the updated patch.

---

From: Dave Page <[email-masked]>
Date: Mon, 10 Jun 2019 14:04:10 +0100

Thanks, applied!

On Mon, Jun 10, 2019 at 10:35 AM Aditya Toshniwal <
[email-masked]> wrote:

>>>> This isn't quite right. When the browser auto-fills the password, the
>>>> OK button remains disabled. I can hit enter though - however, I shouldn't
>>>> be able to do that when the OK button is disabled (being the default button
>>>> on the dialogue, it should respond to enter, unless another control which
>>>> also accepts enter has focus (e.g. a multiline text area).
>>>>