6e88efe11f622572a8f736567342f21cdb3ec9b4
[akkoma] / lib / pleroma / web / templates / o_auth / o_auth / show.html.eex
1 <p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
2 <p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
3 <h2>OAuth Authorization</h2>
4 <%= form_for @conn, o_auth_path(@conn, :authorize), [as: "authorization"], fn f -> %>
5 <%= label f, :name, "Name or email" %>
6 <%= text_input f, :name %>
7 <br>
8 <br>
9 <%= label f, :password, "Password" %>
10 <%= password_input f, :password %>
11 <br>
12 <br>
13
14 <%= label f, :scope, "Permissions" %>
15 <br>
16 <%= for scope <- @available_scopes do %>
17 <%# Note: using hidden input with `unchecked_value` in order to distinguish user's empty selection from `scope` param being omitted %>
18 <%= checkbox f, :"scope_#{scope}", value: scope in @scopes && scope, checked_value: scope, unchecked_value: "", name: "authorization[scope][]" %>
19 <%= label f, :"scope_#{scope}", String.capitalize(scope) %>
20 <br>
21 <% end %>
22
23 <%= hidden_input f, :client_id, value: @client_id %>
24 <%= hidden_input f, :response_type, value: @response_type %>
25 <%= hidden_input f, :redirect_uri, value: @redirect_uri %>
26 <%= hidden_input f, :state, value: @state%>
27 <%= submit "Authorize" %>
28 <% end %>