2016-07-11 03:53:02 -04:00
|
|
|
- if inject_u2f_api?
|
|
|
|
- content_for :page_specific_javascripts do
|
2017-03-07 03:59:12 -05:00
|
|
|
= page_specific_javascript_bundle_tag('u2f')
|
2016-07-11 03:30:22 -04:00
|
|
|
|
2015-03-30 21:19:01 -04:00
|
|
|
%div
|
2016-10-10 10:34:57 -04:00
|
|
|
= render 'devise/shared/tab_single', tab_title: 'Two-Factor Authentication'
|
2015-03-30 21:19:01 -04:00
|
|
|
.login-box
|
|
|
|
.login-body
|
2016-06-06 00:50:39 -04:00
|
|
|
- if @user.two_factor_otp_enabled?
|
2016-12-24 11:53:13 -05: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_u2f_enabled?}" }) do |f|
|
2016-06-06 16:29:52 -04:00
|
|
|
- resource_params = params[resource_name].presence || params
|
|
|
|
= f.hidden_field :remember_me, value: resource_params.fetch(:remember_me, 0)
|
2016-10-19 08:40:58 -04:00
|
|
|
%div
|
2016-09-09 08:21:00 -04:00
|
|
|
= f.label 'Two-Factor Authentication code', name: :otp_attempt
|
|
|
|
= f.text_field :otp_attempt, class: 'form-control', required: true, autofocus: true, autocomplete: 'off', title: 'This field is required.'
|
|
|
|
%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"
|
2016-06-06 00:50:39 -04:00
|
|
|
|
|
|
|
- if @user.two_factor_u2f_enabled?
|
2016-08-19 21:51:56 -04:00
|
|
|
= render "u2f/authenticate", locals: { params: params, resource: resource, resource_name: resource_name }
|