Commit 6781aeb365503606813c0320665819917a51abbf

Authored by Braulio Bhavamitra
2 parents 763189ac eb6f15d0

Merge branch 'improve_oauth_client' into 'master'

Improve oauth client

This MR is related to oauth-client plugin. Fix a bug in edit of providers and improve documentation. Making this plugin up-to-date.

See merge request !821
plugins/oauth_client/README.md
... ... @@ -33,6 +33,14 @@ Facebook
33 33  
34 34 [Create Facebook application](https://developers.facebook.com/docs/facebook-login/v2.1)
35 35  
  36 +Callback
  37 +========
  38 +
  39 +This is the callback path that you need to use in your app configuration:
  40 +
  41 +/plugin/oauth_client/public/callback
  42 +
  43 +
36 44 Varnish Settings
37 45 ================
38 46 If varnish has been used in your stack, you've to bypass the cache for signup page and prevent cookies to be removed when calling the oauth_client plugin callback. E.g.:
... ...
plugins/oauth_client/models/oauth_client_plugin/provider.rb
... ... @@ -11,7 +11,7 @@ class OauthClientPlugin::Provider < ActiveRecord::Base
11 11 settings_items :client_options, type: Hash
12 12  
13 13 attr_accessible :name, :strategy, :enabled, :site, :image_builder,
14   - :environment, :environment_id,
  14 + :environment, :environment_id, :options,
15 15 :client_id, :client_secret, :client_options
16 16  
17 17 scope :enabled, -> { where enabled: true }
... ...
plugins/oauth_client/views/oauth_client_plugin_admin/edit.html.erb
1 1 <h1><%= _('Oauth Client Settings') %></h1>
2 2 <h3><%= _('Edit Provider') %></h3>
3 3  
4   -<%= form_for @provider, :url => {:action => 'edit'}, :method => 'post' do |f| %>
  4 +<%= form_for @provider, :url => {:action => 'edit', :id => @provider.id}, :method => 'post' do |f| %>
5 5  
6 6 <div class="enabled">
7 7 <%= labelled_form_field f.check_box(:enabled) + _('Enabled'), '' %>
... ...