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>
7 <h2>OAuth Authorization</h2>
8 <%= form_for @conn, o_auth_path(@conn, :authorize), [as: "authorization"], fn f -> %>
9 <%= label f, :name, "Name or email" %>
10 <%= text_input f, :name %>
13 <%= label f, :password, "Password" %>
14 <%= password_input f, :password %>
18 <%= label f, :scope, "Permissions" %>
20 <%= for scope <- @available_scopes do %>
21 <%# Note: using hidden input with `unchecked_value` in order to distinguish user's empty selection from `scope` param being omitted %>
22 <%= checkbox f, :"scope_#{scope}", value: scope in @scopes && scope, checked_value: scope, unchecked_value: "", name: "authorization[scope][]" %>
23 <%= label f, :"scope_#{scope}", String.capitalize(scope) %>
27 <%= hidden_input f, :client_id, value: @client_id %>
28 <%= hidden_input f, :response_type, value: @response_type %>
29 <%= hidden_input f, :redirect_uri, value: @redirect_uri %>
30 <%= hidden_input f, :state, value: @state%>
31 <%= submit "Authorize" %>