-
Notifications
You must be signed in to change notification settings - Fork 358
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
Conversation
3ca4a4c
to
5f072a1
Compare
5f072a1
to
475cf53
Compare
if fld['datatype'] == 'password' | ||
fld[field] = params["fields_password_value_#{i}".to_sym] if params["fields_password_value_#{i}".to_sym] | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this change? Doesn't this just do what the field already does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After I add or delete a row, it sends a second fields_form_field_changed
request with a payload with a password_field_value and the original value in default value even though the datatype isnt a password, so I added this check to make sure it was for a non password type
So then when a deletion or addition happens afterwards, the value is set back to the original
@@ -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", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
d31a45f
to
f23b841
Compare
Adds autocomplete attribute to prevent password datatype default values from using password manager values
@miq-bot add-label bug
@miq-bot add-reviewer @GilbertCherrie