mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 06:19:17 +08:00
correct multisite functionality for omniauth
This commit is contained in:
parent
deb603f41c
commit
988a712c77
2
Gemfile
2
Gemfile
|
@ -100,7 +100,7 @@ end
|
|||
|
||||
group :development do
|
||||
gem 'better_errors'
|
||||
gem 'binding_of_caller' # I tried adding this and got an occational crash
|
||||
gem 'binding_of_caller'
|
||||
gem 'librarian', '>= 0.0.25', require: false
|
||||
gem 'pry-rails'
|
||||
end
|
||||
|
|
|
@ -7,31 +7,42 @@ require 'openid_redis_store'
|
|||
Rails.application.config.middleware.use OmniAuth::Builder do
|
||||
|
||||
provider :open_id,
|
||||
store: OpenID::Store::Redis.new($redis),
|
||||
name: 'google',
|
||||
identifier: 'https://www.google.com/accounts/o8/id',
|
||||
require: 'omniauth-openid'
|
||||
:store => OpenID::Store::Redis.new($redis),
|
||||
:name => 'google',
|
||||
:identifier => 'https://www.google.com/accounts/o8/id',
|
||||
:require => 'omniauth-openid'
|
||||
|
||||
provider :open_id,
|
||||
store: OpenID::Store::Redis.new($redis),
|
||||
name: 'yahoo',
|
||||
identifier: 'https://me.yahoo.com',
|
||||
require: 'omniauth-openid'
|
||||
:store => OpenID::Store::Redis.new($redis),
|
||||
:name => 'yahoo',
|
||||
:identifier => 'https://me.yahoo.com',
|
||||
:require => 'omniauth-openid'
|
||||
|
||||
# lambda is required for proper multisite support,
|
||||
# without it subdomains will not function correctly
|
||||
provider :facebook,
|
||||
SiteSetting.facebook_app_id,
|
||||
SiteSetting.facebook_app_secret,
|
||||
scope: "email"
|
||||
:setup => lambda { |env|
|
||||
strategy = env['omniauth.strategy']
|
||||
strategy.options[:client_id] = SiteSetting.facebook_app_id
|
||||
strategy.options[:client_secret] = SiteSetting.facebook_app_secret
|
||||
},
|
||||
:scope => "email"
|
||||
|
||||
provider :twitter,
|
||||
SiteSetting.twitter_consumer_key,
|
||||
SiteSetting.twitter_consumer_secret
|
||||
:setup => lambda { |env|
|
||||
strategy = env['omniauth.strategy']
|
||||
strategy.options[:consumer_key] = SiteSetting.twitter_consumer_key
|
||||
strategy.options[:consumer_secret] = SiteSetting.twitter_consumer_secret
|
||||
}
|
||||
|
||||
provider :github,
|
||||
SiteSetting.github_client_id,
|
||||
SiteSetting.github_client_secret
|
||||
:setup => lambda { |env|
|
||||
strategy = env['omniauth.strategy']
|
||||
strategy.options[:client_id] = SiteSetting.github_client_id
|
||||
strategy.options[:client_secret] = SiteSetting.github_client_secret
|
||||
}
|
||||
|
||||
provider :browser_id,
|
||||
name: 'persona'
|
||||
:name => 'persona'
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user