Commit e76a6765 authored by Stan Hu's avatar Stan Hu

Disable password autocomplete in mirror form fill

Chrome and other browsers ignore autocomplete=false and autocomplete=off
now. This causes the mirroring section to expand whenever a user clicked
"Expand" in the Repository settings.

https://developers.google.com/web/fundamentals/design-and-ux/input/forms/?hl=en
recommends using new-password as the new field to prevent automatic
filling.

It looks like we already do this in app/views/shared/_field.html.haml.

This is a CE backport of
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8477.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/50812
parent e0e813bd
......@@ -15,7 +15,7 @@
.changing-auth-method= icon('spinner spin lg')
.well-password-auth.collapse.js-well-password-auth
= f.label :password, _("Password"), class: "label-bold"
= f.password_field :password, value: mirror.password, class: 'form-control'
= f.password_field :password, value: mirror.password, class: 'form-control', autocomplete: 'new-password'
- unless is_push
.well-ssh-auth.collapse.js-well-ssh-auth
%p.js-ssh-public-key-present{ class: ('collapse' unless ssh_public_key_present) }
......
---
title: Disable password autocomplete in mirror form fill
merge_request: 23402
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment