songkick/oauth2-provider

View on GitHub
example/views/authorize.erb

Summary

Maintainability
Test Coverage
<h3>Authorize OAuth client</h3>

<p>This application <b><%= @oauth2.client.name %></b> wants the following
  permissions:</p>

<ul>
  <% @oauth2.scopes.each do |scope| %>
    <% next unless PERMISSIONS[scope] %>
    <li><%= PERMISSIONS[scope] %></li>
  <% end %>
</ul>

<form method="post" action="/oauth/allow">
  <% @oauth2.params.each do |key, value| %>
    <input type="hidden" name="<%= key %>" value="<%= value %>">
  <% end %>
  <input type="hidden" name="user_id" value="<%= @user.id %>">

  <fieldset>
    <input type="checkbox" name="allow" id="allow" value="1">
    <label for="allow">Allow this application</label>
  </fieldset>

  <fieldset>
    <input type="submit" value="Go!">
  </fieldset>
</form>