Adding OAuth access scopes, fixing OAuth authorization UI, adding rate limiting
to the API
This commit is contained in:
@ -1,4 +0,0 @@
|
||||
.prompt= t('doorkeeper.authorizations.error.title')
|
||||
|
||||
#error_explanation
|
||||
= @pre_auth.error_response.body[:error_description]
|
@ -1,26 +0,0 @@
|
||||
.prompt= raw t('.prompt', client_name: "<strong class=\"prompt-highlight\">#{ @pre_auth.client.name }</strong>")
|
||||
|
||||
/- if @pre_auth.scopes.count > 0
|
||||
/ .scope-permission-prompt
|
||||
/ %p= t('.able_to')
|
||||
|
||||
/ %ul.scope-permissions
|
||||
/ - @pre_auth.scopes.each do |scope|
|
||||
/ %li= t scope, scope: [:doorkeeper, :scopes]
|
||||
|
||||
.actions
|
||||
= form_tag oauth_authorization_path, method: :post do
|
||||
= hidden_field_tag :client_id, @pre_auth.client.uid
|
||||
= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri
|
||||
= hidden_field_tag :state, @pre_auth.state
|
||||
= hidden_field_tag :response_type, @pre_auth.response_type
|
||||
= hidden_field_tag :scope, @pre_auth.scope
|
||||
= button_tag t('doorkeeper.authorizations.buttons.authorize'), type: :submit
|
||||
|
||||
= form_tag oauth_authorization_path, method: :delete do
|
||||
= hidden_field_tag :client_id, @pre_auth.client.uid
|
||||
= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri
|
||||
= hidden_field_tag :state, @pre_auth.state
|
||||
= hidden_field_tag :response_type, @pre_auth.response_type
|
||||
= hidden_field_tag :scope, @pre_auth.scope
|
||||
= button_tag t('doorkeeper.authorizations.buttons.deny'), type: :submit, class: 'negative'
|
@ -1,2 +0,0 @@
|
||||
.prompt= t('.title')
|
||||
%code.copypasteable= params[:code]
|
2
app/views/oauth/authorizations/error.html.haml
Normal file
2
app/views/oauth/authorizations/error.html.haml
Normal file
@ -0,0 +1,2 @@
|
||||
.flash-message#error_explanation
|
||||
= @pre_auth.error_response.body[:error_description]
|
25
app/views/oauth/authorizations/new.html.haml
Normal file
25
app/views/oauth/authorizations/new.html.haml
Normal file
@ -0,0 +1,25 @@
|
||||
.oauth-prompt
|
||||
%h2
|
||||
Application
|
||||
%strong=@pre_auth.client.name
|
||||
requests access to your account
|
||||
|
||||
%p
|
||||
It will be able to
|
||||
= @pre_auth.scopes.map { |scope| t(scope, scope: [:doorkeeper, :scopes]) }.map { |s| "<strong>#{s}</strong>"}.to_sentence.html_safe
|
||||
|
||||
= form_tag oauth_authorization_path, method: :post, class: 'simple_form' do
|
||||
= hidden_field_tag :client_id, @pre_auth.client.uid
|
||||
= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri
|
||||
= hidden_field_tag :state, @pre_auth.state
|
||||
= hidden_field_tag :response_type, @pre_auth.response_type
|
||||
= hidden_field_tag :scope, @pre_auth.scope
|
||||
= button_tag t('doorkeeper.authorizations.buttons.authorize'), type: :submit
|
||||
|
||||
= form_tag oauth_authorization_path, method: :delete, class: 'simple_form' do
|
||||
= hidden_field_tag :client_id, @pre_auth.client.uid
|
||||
= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri
|
||||
= hidden_field_tag :state, @pre_auth.state
|
||||
= hidden_field_tag :response_type, @pre_auth.response_type
|
||||
= hidden_field_tag :scope, @pre_auth.scope
|
||||
= button_tag t('doorkeeper.authorizations.buttons.deny'), type: :submit, class: 'negative'
|
1
app/views/oauth/authorizations/show.html.haml
Normal file
1
app/views/oauth/authorizations/show.html.haml
Normal file
@ -0,0 +1 @@
|
||||
%code= params[:code]
|
Reference in New Issue
Block a user