summaryrefslogtreecommitdiff
path: root/app/views/profiles/two_factor_auths/new.html.haml
blob: 69fc81cb45c66327b7d54b400ad9fc2ae3659f1a (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
29
30
31
32
33
34
35
36
37
38
39
- page_title 'Two-factor Authentication', 'Account'

.row.prepend-top-default
  .col-lg-3
    %h4.prepend-top-0
      Two-factor Authentication (2FA)
    %p
      Increase your account's security by enabling two-factor authentication (2FA).
  .col-lg-9
    %p
      Download the Google Authenticator application from App Store for iOS or Google Play for Android and scan this code.
      More information is available in the #{link_to('documentation', help_page_path('profile', 'two_factor_authentication'))}.
    .row.append-bottom-10
      .col-md-3
        = raw @qr_code
      .col-md-9
        .account-well
          %p.prepend-top-0.append-bottom-0
            Can't scan the code?
          %p.prepend-top-0.append-bottom-0
            To add the entry manually, provide the following details to the application on your phone.
          %p.prepend-top-0.append-bottom-0
            Account:
            = current_user.email
          %p.prepend-top-0.append-bottom-0
            Key:
            = current_user.otp_secret.scan(/.{4}/).join(' ')
          %p.two-factor-new-manual-content
            Time based: Yes
    = form_tag profile_two_factor_auth_path, method: :post do |f|
      - if @error
        .alert.alert-danger
          = @error
      .form-group
        = label_tag :pin_code, nil, class: "label-light"
        = text_field_tag :pin_code, nil, class: "form-control", required: true
      .prepend-top-default
        = submit_tag 'Enable two-factor authentication', class: 'btn btn-success'
        = link_to 'Configure it later', skip_profile_two_factor_auth_path, :method => :patch,  class: 'btn btn-cancel' if two_factor_skippable?