2015-09-11 14:41:01 +05:30
%div
2016-11-03 12:29:30 +05:30
= render 'devise/shared/tab_single', tab_title: 'Two-Factor Authentication'
2015-09-11 14:41:01 +05:30
.login-box
.login-body
2016-06-16 23:09:34 +05:30
- if @user.two_factor_otp_enabled?
2017-08-17 22:00:37 +05:30
= 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_u2f_enabled?}" }) do |f|
2016-06-16 23:09:34 +05:30
- resource_params = params[resource_name].presence || params
= f.hidden_field :remember_me, value: resource_params.fetch(:remember_me, 0)
2016-11-03 12:29:30 +05:30
%div
2019-03-02 22:35:43 +05:30
= f.label 'Two-Factor Authentication code', name: :otp_attempt
2016-11-03 12:29:30 +05:30
= f.text_field :otp_attempt, class: 'form-control', required: true, autofocus: true, autocomplete: 'off', title: 'This field is required.'
2018-11-08 19:23:39 +05:30
%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-11-03 12:29:30 +05:30
.prepend-top-20
2018-12-05 23:21:45 +05:30
= f.submit "Verify code", class: "btn btn-success"
2016-06-16 23:09:34 +05:30
- if @user.two_factor_u2f_enabled?
2016-09-29 09:46:39 +05:30
= render "u2f/authenticate", locals: { params: params, resource: resource, resource_name: resource_name }