BigW Consortium Gitlab

two_factor.html.haml 1.1 KB
Newer Older
1 2
- if inject_u2f_api?
  - content_for :page_specific_javascripts do
3 4
    = page_specific_javascript_tag('u2f.js')

5 6 7
%div
  .login-box
    .login-heading
8
      %h3 Two-Factor Authentication
9
    .login-body
10 11 12
      - if @user.two_factor_otp_enabled?
        %h5 Authenticate via Two-Factor App
        = form_for(resource, as: resource_name, url: session_path(resource_name), method: :post) do |f|
13 14
          - resource_params = params[resource_name].presence || params
          = f.hidden_field :remember_me, value: resource_params.fetch(:remember_me, 0)
15 16 17 18 19 20 21
          = f.text_field :otp_attempt, class: 'form-control', placeholder: 'Two-Factor Authentication code', required: true, autofocus: true, autocomplete: 'off'
          %p.help-block.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.
          .prepend-top-20
            = f.submit "Verify code", class: "btn btn-save"

      - if @user.two_factor_u2f_enabled?
        %hr
22
        = render "u2f/authenticate", locals: { params: params, resource: resource, resource_name: resource_name }