Skip to content
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

Inplace: does not consider masked text of Password #9538

Closed
nimo23 opened this issue Dec 21, 2022 · 5 comments · Fixed by #9539 or #9548
Closed

Inplace: does not consider masked text of Password #9538

nimo23 opened this issue Dec 21, 2022 · 5 comments · Fixed by #9539 or #9548
Assignees
Labels
🐞 defect Bug...Something isn't working
Milestone

Comments

@nimo23
Copy link
Contributor

nimo23 commented Dec 21, 2022

Description

Currently, the p:inplace does not consider to leave the text from an embeeded p:password masked (if enabled).

<p:inplace>
	<p:password value="#{user.password}" match="pw2" toggleMask="true" redisplay="true" />
</p:inplace>

The password is shown by p:inplace unmasked even if the p:password masks it.

Describe the solution you would like

If the user has something like this:

<p:inplace>
	<p:password value="#{user.password}" match="pw2" toggleMask="true" redisplay="true" />
</p:inplace>

Then p:inplace should leave the password text masked (in input and output mode). Only when the user toggles the mask by p:password, then the password should be unmasked.

Additional context

No response

@nimo23 nimo23 added ‼️ needs-triage Issue needs triaging new feature labels Dec 21, 2022
@jepsar jepsar changed the title p:inplace: does not consider masked text of p:password Inplace: does not consider masked text of Password Dec 21, 2022
@melloware
Copy link
Member

Yikes that is bad. Have you tried it without toggleMask="true" redisplay="true" to see if one of those two properties is the culprit?

@nimo23
Copy link
Contributor Author

nimo23 commented Dec 21, 2022

Using this:

<p:inplace>
	<p:password value="#{user.password}" match="pw2" toggleMask="false" redisplay="false" />
</p:inplace>

or that

<p:inplace>
	<p:password value="#{user.password}" match="pw2"  />
</p:inplace>

does not help.

The masked text is always unmasked (regardless of the settings of p:password) when embedded in p:inplace. I think because p:inplace just extracts the text from the input field without considering if this is an input field of type password.

I think, to resolve this issue, p:inplace must look if its embeeded input field is of type password or if the component is a p:password - if so then it should be masked (if p:password sets it to masked), otherwise to unmasked (if p:password sets it to unmasked).

@melloware
Copy link
Member

Agreed. I will take a look.

@melloware melloware added 🐞 defect Bug...Something isn't working and removed new feature ‼️ needs-triage Issue needs triaging labels Dec 21, 2022
@melloware melloware self-assigned this Dec 21, 2022
@melloware melloware added this to the 13.0.0 milestone Dec 21, 2022
@melloware
Copy link
Member

Reproducer:
pf-9538.zip

@melloware
Copy link
Member

I just chose to mask it with "*********" regardless of length of the password. Unfrotunately the toggleMask is a JS client side property and the InPlacerenderer is a server side component so it has to always be masked.

melloware added a commit to melloware/primefaces that referenced this issue Dec 21, 2022
melloware added a commit that referenced this issue Dec 21, 2022
* Jquery 3.6.3

* Fix #9538: Inplace always mask passwords

* Fix #9538: Inplace always mask passwords
jepsar added a commit to jepsar/primefaces that referenced this issue Dec 24, 2022
melloware pushed a commit that referenced this issue Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment