debian-mirror-gitlab/app/views/devise/sessions/two_factor.html.haml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
1.5 KiB
Text
Raw Normal View History

2015-09-11 14:41:01 +05:30
%div
2022-08-27 11:52:29 +05:30
= render 'devise/shared/tab_single', tab_title: _('Two-Factor Authentication') if Feature.disabled?(:restyle_login_page, @project)
2022-07-16 23:28:13 +05:30
.login-box.gl-p-5
2015-09-11 14:41:01 +05:30
.login-body
2023-07-09 08:55:56 +05:30
- if @user.two_factor_enabled?
2023-05-27 22:25:52 +05:30
= gitlab_ui_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_enabled?}" }) do |f|
- resource_params = params[resource_name].presence || params
2023-07-09 08:55:56 +05:30
- if remember_me_enabled?
= f.hidden_field :remember_me, value: resource_params.fetch(:remember_me, 0)
2016-11-03 12:29:30 +05:30
%div
2023-05-27 22:25:52 +05:30
= f.label _('Enter verification code'), name: :otp_attempt, class: Feature.enabled?(:restyle_login_page, @project) ? 'gl-mb-1' : ''
= f.text_field :otp_attempt, class: 'form-control gl-form-input', required: true, autofocus: true, autocomplete: 'off', inputmode: 'numeric', title: _('This field is required.'), data: { qa_selector: 'two_fa_code_field' }
%p.form-text.text-muted.hint= _("Enter the code from your two-factor authenticator app. If you've lost your device, you can enter one of your recovery codes.")
2016-11-03 12:29:30 +05:30
.prepend-top-20
2023-03-17 16:20:25 +05:30
= f.submit _("Verify code"), pajamas_button: true, data: { qa_selector: 'verify_code_button' }
2023-05-27 22:25:52 +05:30
- if @user.two_factor_webauthn_enabled?
2020-11-24 15:15:51 +05:30
= render "authentication/authenticate", params: params, resource: resource, resource_name: resource_name, render_remember_me: true, target_path: new_user_session_path