_register.html.haml 1.83 KB
Newer Older
Timothy Andrew's avatar
Timothy Andrew committed
1
2
#js-register-u2f

3
-# haml-lint:disable InlineJavaScript
Timothy Andrew's avatar
Timothy Andrew committed
4
5
6
7
%script#js-register-u2f-not-supported{ type: "text/template" }
  %p Your browser doesn't support U2F. Please use Google Chrome desktop (version 41 or newer).

%script#js-register-u2f-setup{ type: "text/template" }
8
9
  - if current_user.two_factor_otp_enabled?
    .row.append-bottom-10
10
      .col-md-4
11
        %button#js-setup-u2f-device.btn.btn-info.btn-block Set up new U2F device
12
      .col-md-8
13
14
15
        %p Your U2F device needs to be set up. Plug it in (if not already) and click the button on the left.
  - else
    .row.append-bottom-10
16
      .col-md-4
17
        %button#js-setup-u2f-device.btn.btn-info.btn-block{ disabled: true } Set up new U2F device
18
      .col-md-8
19
        %p.text-warning You need to register a two-factor authentication app before you can set up a U2F device.
Timothy Andrew's avatar
Timothy Andrew committed
20
21
22
23
24
25
26

%script#js-register-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-register-u2f-error{ type: "text/template" }
  %div
    %p
27
      %span <%= error_message %> (error code: <%= error_code %>)
Timothy Andrew's avatar
Timothy Andrew committed
28
29
30
    %a.btn.btn-warning#js-u2f-try-again Try again?

%script#js-register-u2f-registered{ type: "text/template" }
31
  .row.append-bottom-10
32
33
34
35
36
37
38
39
    .col-md-12
      %p Your device was successfully set up! Give it a name and register it with the GitLab server.
      = form_tag(create_u2f_profile_two_factor_auth_path, method: :post) do
        .row.append-bottom-10
          .col-md-3
            = text_field_tag 'u2f_registration[name]', nil, class: 'form-control', placeholder: "Pick a name"
          .col-md-3
            = hidden_field_tag 'u2f_registration[device_response]', nil, class: 'form-control', required: true, id: "js-device-response"
Jose Ivan Vargas's avatar
Jose Ivan Vargas committed
40
            = submit_tag "Register U2F device", class: "btn btn-success"