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

Text field with type: :password leaks value through stimulus data values #307

Open
forsbergplustwo opened this issue Jul 10, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@forsbergplustwo
Copy link
Collaborator

The following component:

        <% form_layout.with_item do %>
          <%= form.polaris_text_field(
            :password,
            label: t(".password_label"),
            type: :password,
            value: smtp_config.password.presence,
          ) %>

Leaks the password value in the data attributes added for Stimulus controller:

CleanShot 2023-07-08 at 02 57 47

The form itself correctly masks the password value, but stimulus would also need to mask it for type: :password.

Note: The value must be passed explicitly for the dot dot dot mask to show up in browsers. When no value is set then the field looks empty, which is confusing as well.

I'll see if I can come up with a PR to fix the above.

@kirillplatonov kirillplatonov added the bug Something isn't working label Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants