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

Fix Chrome autofilling password when editing a schema #9296

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/views/miq_ae_class/_class_fields.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
= password_field_tag("fields_password_value_#{i}", '',
:placeholder => placeholder_if_present(default_value),
:style => field['datatype'] == "password" ? "" : "display:none",
:autocomplete => "new-password",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking we should just turn autocomplete off. The reason is that it's unlikely that an automate password is something that someone would want to save in their browser and then fill in later. That's usually reserved for the main login to the application, but here I don't think it makes sense.

Copy link
Contributor Author

@liu-samuel liu-samuel Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this because the passwords are auto completing right now. I looked around on how to disable it and came across this, and once I added it the auto complete went away.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, new-password is definitely better than nothing., however, I was more thinking that off might be an even better choice. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete for more details on the values.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then again https://stackoverflow.com/questions/15738259/disabling-chrome-autofill seems to be saying that Chrome is ignoring the value

"data-miq_observe" => obs)
- else
= text_field_tag("fields_#{fname}_#{i}", field[fname],
Expand Down