Commit 7b92b4e3cdb8f98f84587895fca46df77e950f05
1 parent
23837332
Exists in
staging
and in
4 other branches
oauth_provider: use noosfero layout in doorkeeper views
Showing
7 changed files
with
55 additions
and
2 deletions
Show diff stats
plugins/oauth_client/lib/omniauth/strategies/noosfero_oauth2.rb
@@ -4,6 +4,10 @@ module OmniAuth | @@ -4,6 +4,10 @@ module OmniAuth | ||
4 | module Strategies | 4 | module Strategies |
5 | class NoosferoOauth2 < OmniAuth::Strategies::OAuth2 | 5 | class NoosferoOauth2 < OmniAuth::Strategies::OAuth2 |
6 | option :name, :noosfero_oauth2 | 6 | option :name, :noosfero_oauth2 |
7 | + option :client_options, { | ||
8 | + :authorize_url => '/oauth_provider/oauth/authorize', | ||
9 | + :token_url => '/oauth_provider/oauth/token' | ||
10 | + } | ||
7 | 11 | ||
8 | uid { raw_info["id"] } | 12 | uid { raw_info["id"] } |
9 | 13 |
plugins/oauth_provider/controllers/doorkeeper/application_controller.rb
0 → 100644
plugins/oauth_provider/controllers/oauth_provider_applications_controller.rb
0 → 100644
plugins/oauth_provider/controllers/oauth_provider_authorized_applications_controller.rb
0 → 100644
plugins/oauth_provider/controllers/oauth_provider_plugin_admin_controller.rb
0 → 100644
plugins/oauth_provider/lib/oauth_provider_plugin.rb
@@ -104,8 +104,17 @@ class OauthProviderPlugin < Noosfero::Plugin | @@ -104,8 +104,17 @@ class OauthProviderPlugin < Noosfero::Plugin | ||
104 | # wildcard_redirect_uri false | 104 | # wildcard_redirect_uri false |
105 | end | 105 | end |
106 | 106 | ||
107 | - Rails.application.routes.prepend do | ||
108 | - use_doorkeeper | 107 | + Rails.configuration.to_prepare do |
108 | + Rails.application.routes.prepend do | ||
109 | + scope 'oauth_provider' do | ||
110 | + use_doorkeeper do | ||
111 | + controllers ({ | ||
112 | + :applications => 'oauth_provider_applications', | ||
113 | + :authorized_applications => 'oauth_provider_authorized_applications' | ||
114 | + }) | ||
115 | + end | ||
116 | + end | ||
117 | + end | ||
109 | end | 118 | end |
110 | 119 | ||
111 | end | 120 | end |
plugins/oauth_provider/views/oauth_provider_plugin_admin/index.html.erb
0 → 100644
@@ -0,0 +1,11 @@ | @@ -0,0 +1,11 @@ | ||
1 | +<div class="oauth-provider"> | ||
2 | + <h3><%= _('Oauh Provider') %></h3> | ||
3 | + | ||
4 | + <div class="applications"> | ||
5 | + <%= link_to _('Applications'), oauth_applications_path %> | ||
6 | + </div> | ||
7 | + <div class="authorized-applications"> | ||
8 | + <%= link_to _('Authorized Applications'), oauth_authorized_applications_path %> | ||
9 | + </div> | ||
10 | + | ||
11 | +</div> |