about summary refs log tree commit diff
path: root/app/views/oauth/authorizations
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-22 19:38:47 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-22 19:39:44 +0200
commita9e40a3d80435431f689b8d19005dd77a8f50224 (patch)
tree48573a1f1ec9c14789c529de3b8fb8badfb20444 /app/views/oauth/authorizations
parent17122df80dc7e85910a9cfa049d2e33ef84288c6 (diff)
Adding OAuth access scopes, fixing OAuth authorization UI, adding rate limiting
to the API
Diffstat (limited to 'app/views/oauth/authorizations')
-rw-r--r--app/views/oauth/authorizations/error.html.haml2
-rw-r--r--app/views/oauth/authorizations/new.html.haml25
-rw-r--r--app/views/oauth/authorizations/show.html.haml1
3 files changed, 28 insertions, 0 deletions
diff --git a/app/views/oauth/authorizations/error.html.haml b/app/views/oauth/authorizations/error.html.haml
new file mode 100644
index 000000000..ee72d9740
--- /dev/null
+++ b/app/views/oauth/authorizations/error.html.haml
@@ -0,0 +1,2 @@
+.flash-message#error_explanation
+  = @pre_auth.error_response.body[:error_description]
diff --git a/app/views/oauth/authorizations/new.html.haml b/app/views/oauth/authorizations/new.html.haml
new file mode 100644
index 000000000..ba5d426f5
--- /dev/null
+++ b/app/views/oauth/authorizations/new.html.haml
@@ -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'
diff --git a/app/views/oauth/authorizations/show.html.haml b/app/views/oauth/authorizations/show.html.haml
new file mode 100644
index 000000000..d1a3e1f81
--- /dev/null
+++ b/app/views/oauth/authorizations/show.html.haml
@@ -0,0 +1 @@
+%code= params[:code]