summaryrefslogtreecommitdiff
path: root/app/views/doorkeeper/authorizations/new.html.haml
blob: f0e7a96f69f166a43d89b41bd841a7d291c505ec (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
40
41
42
43
44
45
46
47
48
49
50
51
%main{ :role => "main" }
  .modal-dialog.modal-doorkeepr-auth
    .modal-content.gl-shadow-none
      .modal-header
        %h3.page-title
          - link_to_client = link_to(@pre_auth.client.name, @pre_auth.redirect_uri, target: '_blank', rel: 'noopener noreferrer')
          = _("Authorize %{link_to_client} to use your account?").html_safe % { link_to_client: link_to_client }

      .modal-body
        - if current_user.admin?
          .text-warning
            %p
              = sprite_icon('warning-solid')
              = html_escape(_('You are an admin, which means granting access to %{client_name} will allow them to interact with GitLab as an admin as well. Proceed with caution.')) % { client_name: tag.strong(@pre_auth.client.name) }
        %p
          - link_to_client = link_to(@pre_auth.client.name, @pre_auth.redirect_uri, target: '_blank', rel: 'noopener noreferrer')
          = _("An application called %{link_to_client} is requesting access to your GitLab account.").html_safe % { link_to_client: link_to_client }

          - auth_app_owner = @pre_auth.client.application.owner

          = auth_app_owner_text(auth_app_owner)
          = _("Please note that this application is not provided by GitLab and you should verify its authenticity before allowing access.")
        - if @pre_auth.scopes
          %p
            = _("This application will be able to:")
            %ul
              - @pre_auth.scopes.each do |scope|
                %li
                  %strong= t scope, scope: [:doorkeeper, :scopes]
                  .text-secondary= t scope, scope: [:doorkeeper, :scope_desc]
        .form-actions.text-right
          = form_tag oauth_authorization_path, method: :delete, class: 'inline' do
            = hidden_field_tag :client_id, @pre_auth.client.uid
            = hidden_field_tag :redirect_uri, @pre_auth.redirect_uri
            = hidden_field_tag :state, @pre_auth.state
            = hidden_field_tag :response_type, @pre_auth.response_type
            = hidden_field_tag :scope, @pre_auth.scope
            = hidden_field_tag :nonce, @pre_auth.nonce
            = hidden_field_tag :code_challenge, @pre_auth.code_challenge
            = hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method
            = submit_tag _("Deny"), class: "gl-button btn btn-danger"
          = form_tag oauth_authorization_path, method: :post, class: 'inline' do
            = hidden_field_tag :client_id, @pre_auth.client.uid
            = hidden_field_tag :redirect_uri, @pre_auth.redirect_uri
            = hidden_field_tag :state, @pre_auth.state
            = hidden_field_tag :response_type, @pre_auth.response_type
            = hidden_field_tag :scope, @pre_auth.scope
            = hidden_field_tag :nonce, @pre_auth.nonce
            = hidden_field_tag :code_challenge, @pre_auth.code_challenge
            = hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method
            = submit_tag _("Authorize"), class: "gl-button btn btn-confirm gl-ml-3", data: { qa_selector: 'authorization_button' }