danschultzer / phoenix_oauth2_provider

Get an OAuth 2 provider running in your phoenix with controllers, views and models in just two minutes
MIT License
84 stars 41 forks source link

Cleanup form markup for authorization #28

Open LostKobrakai opened 4 years ago

LostKobrakai commented 4 years ago

Instead of two separate forms you could have one form with many submit buttons:

    <%= form_tag "#" do %>
        <input type="hidden" name="client_id" value="<%= @params["client_id"] %>" />
        <input type="hidden" name="redirect_uri" value="<%= @params["redirect_uri"] %>" />
        <input type="hidden" name="state" value="<%= @params["state"] %>" />
        <input type="hidden" name="response_type" value="<%= @params["response_type"] %>" />
        <input type="hidden" name="scope" value="<%= @params["scope"] %>" />
        <%= submit "Authorize", formaction: Routes.oauth_authorization_path(@conn, :create) %>
        <%= submit "Deny", name: "_method", value: "delete", formaction: Routes.oauth_authorization_path(@conn, :delete) %>
    <% end %>