summaryrefslogtreecommitdiff
path: root/app/views/u2f/_authenticate.html.haml
blob: 75fb0e303ada8cb196d366576b5c574e78960ea4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#js-authenticate-u2f

%script#js-authenticate-u2f-not-supported{ type: "text/template" }
  %p Your browser doesn't support U2F. Please use Google Chrome desktop (version 41 or newer).

%script#js-authenticate-u2f-setup{ type: "text/template" }
  %div
    %p Insert your security key (if you haven't already), and press the button below.
    %a.btn.btn-info#js-login-u2f-device{ href: 'javascript:void(0)' } Login Via U2F Device

%script#js-authenticate-u2f-in-progress{ type: "text/template" }
  %p Trying to communicate with your device. Plug it in (if you haven't already) and press the button on the device now.

%script#js-authenticate-u2f-error{ type: "text/template" }
  %div
    %p <%= error_message %>
    %a.btn.btn-warning#js-u2f-try-again Try again?

%script#js-authenticate-u2f-authenticated{ type: "text/template" }
  %div
    %p We heard back from your U2F device. Click this button to authenticate with the GitLab server.
    = form_tag(new_user_session_path, method: :post) do |f|
      = hidden_field_tag 'user[device_response]', nil, class: 'form-control', required: true, id: "js-device-response"
      = submit_tag "Authenticate via U2F Device", class: "btn btn-success"

:javascript
  var u2fAuthenticate = new U2FAuthenticate($("#js-authenticate-u2f"), gon.u2f);
  u2fAuthenticate.start();