summaryrefslogtreecommitdiffstats
path: root/app/views/doorkeeper/authorizations/new.html.erb
blob: 898f2e645ff7cbe7a12bad911a20a7994215f675 (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
<%= title t('.title') %>

<div class="warning">
<p><strong><%=h @pre_auth.client.name %></strong></p>

<p><%= raw t('.prompt', client_name: content_tag(:strong, class: "text-info") { @pre_auth.client.name }) %></p>

<div class="oauth-permissions">
  <p><%= t('.able_to') %>:</p>
  <ul>
    <li><%= l :text_oauth_implicit_permissions %></li>
    <% @pre_auth.scopes.each do |scope| %>
      <% if scope == 'admin' %>
        <li><%= l :label_oauth_permission_admin %></li>
      <% else %>
        <li><%= l_or_humanize(scope, prefix: 'permission_') %></li>
      <% end %>
    <% end %>
  </ul>
</div>

<% if @pre_auth.scopes.include?('admin') %>
  <p><%= l :text_oauth_admin_permission_info %></p>
<% end %>
</div>

<p>
  <%= form_tag oauth_authorization_path, method: :post 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 :code_challenge, @pre_auth.code_challenge %>
    <%= hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method %>
    <%= submit_tag t('doorkeeper.authorizations.buttons.authorize') %>
  <% end %>
  <%= form_tag oauth_authorization_path, method: :delete 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 :code_challenge, @pre_auth.code_challenge %>
    <%= hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method %>
    <%= submit_tag t('doorkeeper.authorizations.buttons.deny') %>
  <% end %>
</p>