Set autocomplete attributes on username & password fields

This commit is contained in:
Karina Kwiatek 2022-06-27 23:33:25 +02:00 committed by Karina Kwiatek
parent 9dedf447a6
commit 805e3504c7
4 changed files with 11 additions and 11 deletions

View File

@ -9,10 +9,10 @@
= render "devise/shared/error_messages", resource: resource
= render "layouts/messages"
= f.text_field :screen_name, autofocus: true
= f.email_field :email, autofocus: false
= f.password_field :password, autocomplete: :off
= f.password_field :password_confirmation, autocomplete: :off
= f.text_field :screen_name, autofocus: true, autocomplete: :username
= f.email_field :email, autofocus: false, autocomplete: :email
= f.password_field :password, autocomplete: "new-password"
= f.password_field :password_confirmation, autocomplete: "new-password"
- if APP_CONFIG.dig(:hcaptcha, :enabled)
= hcaptcha_tags

View File

@ -8,8 +8,8 @@
%h1.mb-3.mt-0= t(".title")
= bootstrap_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
= f.text_field :login, autofocus: true
= f.password_field :password, autocomplete: :off
= f.text_field :login, autofocus: true, autocomplete: :username
= f.password_field :password, autocomplete: "current-password"
- if devise_mapping.rememberable?
= f.check_box :remember_me

View File

@ -7,7 +7,7 @@
%span{ aria: { hidden: true } } ×
%span.sr-only= t("voc.close")
.modal-body
= f.password_field :current_password, autocomplete: :off
= f.password_field :current_password, autocomplete: "current-password"
.modal-footer
%button.btn.btn-default{ data: { dismiss: :modal }, type: :button }= t("voc.cancel")
= f.primary

View File

@ -4,14 +4,14 @@
= render "modal/password", f: f
= render "devise/shared/error_messages", resource: resource
= f.text_field :screen_name, autofocus: true
= f.text_field :screen_name, autofocus: true, autocomplete: :username
= f.email_field :email
= f.email_field :email, autocomplete: :email
- if devise_mapping.confirmable? && resource.pending_reconfirmation?
.alert.alert-info= raw t(".email_confirm", resource: resource.unconfirmed_email)
= f.password_field :password, autocomplete: :off, help: t(".help.password")
= f.password_field :password_confirmation, autocomplete: :off
= f.password_field :password, autocomplete: "new-password", help: t(".help.password")
= f.password_field :password_confirmation, autocomplete: "new-password"
%button.btn.btn-primary{ data: { target: "#modal-passwd", toggle: :modal, type: :button } }
= t("voc.save")