1 <%= if get_flash(@conn, :info) do %>
2 <p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
4 <%= if get_flash(@conn, :error) do %>
5 <p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
8 <h2>OAuth Authorization</h2>
10 <%= form_for @conn, o_auth_path(@conn, :authorize), [as: "authorization"], fn f -> %>
12 <%= label f, :name, "Name or email" %>
13 <%= text_input f, :name %>
16 <%= label f, :password, "Password" %>
17 <%= password_input f, :password %>
19 <div class="scopes-input">
20 <%= label f, :scope, "Permissions" %>
22 <%= for scope <- @available_scopes do %>
23 <%# Note: using hidden input with `unchecked_value` in order to distinguish user's empty selection from `scope` param being omitted %>
25 <%= checkbox f, :"scope_#{scope}", value: scope in @scopes && scope, checked_value: scope, unchecked_value: "", name: "authorization[scope][]" %>
26 <%= label f, :"scope_#{scope}", String.capitalize(scope) %>
32 <%= hidden_input f, :client_id, value: @client_id %>
33 <%= hidden_input f, :response_type, value: @response_type %>
34 <%= hidden_input f, :redirect_uri, value: @redirect_uri %>
35 <%= hidden_input f, :state, value: @state%>
36 <%= submit "Authorize" %>
39 <%= if Pleroma.Config.get([:auth, :oauth_consumer_enabled]) do %>
41 <%= render @view_module, "consumer.html", assigns %>