Permalink
Browse files

Do not initialize authentications if there is no entries in config

  • Loading branch information...
1 parent 6c3d7cc commit c9fedcb810fced3b8cda22d4c33ab0617f962245 @antono committed Jul 14, 2012
Showing with 13 additions and 7 deletions.
  1. +13 −7 config/initializers/auth.rb
@@ -4,15 +4,21 @@
provider :developer unless Rails.env.production?
- provider :github, Shelr.config['github']['id'], Shelr.config['github']['secret'],
- :client_options => {:ssl => {:ca_path => '/etc/ssl/certs'} }
+ if Shelr.config['github']
+ provider :github, Shelr.config['github']['id'], Shelr.config['github']['secret'],
+ :client_options => {:ssl => {:ca_path => '/etc/ssl/certs'} }
+ end
- provider :twitter, Shelr.config['twitter']['id'], Shelr.config['twitter']['secret']
+ if Shelr.config['twitter']
+ provider :twitter, Shelr.config['twitter']['id'], Shelr.config['twitter']['secret']
+ end
- provider :google_oauth2, Shelr.config['google']['id'], Shelr.config['google']['secret'], {
- :access_type => 'online',
- :approval_prompt => ''
- }
+ if Shelr.config['google']
+ provider :google_oauth2, Shelr.config['google']['id'], Shelr.config['google']['secret'], {
+ :access_type => 'online',
+ :approval_prompt => ''
+ }
+ end
provider :open_id, :store => OpenID::Store::Filesystem.new('/tmp')
end

0 comments on commit c9fedcb

Please sign in to comment.