2015-03-31 01:19:01 +00:00
%div
2016-10-10 14:34:57 +00:00
= render 'devise/shared/tab_single', tab_title: 'Two-Factor Authentication'
2015-03-31 01:19:01 +00:00
.login-box
.login-body
2016-06-06 04:50:39 +00:00
- if @user.two_factor_otp_enabled?
2020-09-07 12:08:27 +00:00
= form_for(resource, as: resource_name, url: session_path(resource_name), method: :post, html: { class: "edit_user gl-show-field-errors js-2fa-form #{'hidden' if @user.two_factor_webauthn_u2f_enabled?}" }) do |f|
2016-06-06 20:29:52 +00:00
- resource_params = params[resource_name].presence || params
= f.hidden_field :remember_me, value: resource_params.fetch(:remember_me, 0)
2016-10-19 12:40:58 +00:00
%div
2019-01-16 12:09:29 +00:00
= f.label 'Two-Factor Authentication code', name: :otp_attempt
2020-07-01 15:08:45 +00:00
= f.text_field :otp_attempt, class: 'form-control', required: true, autofocus: true, autocomplete: 'off', title: 'This field is required.', data: { qa_selector: 'two_fa_code_field' }
2018-04-11 18:26:37 +00:00
%p.form-text.text-muted.hint Enter the code from the two-factor app on your mobile device. If you've lost your device, you may enter one of your recovery codes.
2016-09-09 12:21:00 +00:00
.prepend-top-20
2020-10-20 15:08:57 +00:00
= f.submit "Verify code", class: "gl-button btn btn-success", data: { qa_selector: 'verify_code_button' }
2020-09-07 12:08:27 +00:00
- if @user.two_factor_webauthn_u2f_enabled?
= render "authentication/authenticate", params: params, resource: resource, resource_name: resource_name, render_remember_me: true, target_path: new_user_session_path