we need email scope (also as I edit files I like to keep quoting consistent)

This commit is contained in:
Sam 2013-08-02 09:47:54 +10:00
parent 75345c1f8f
commit 2162e3bbb5
1 changed files with 15 additions and 14 deletions

View File

@ -1,5 +1,5 @@
require 'openssl' require "openssl"
require 'openid_redis_store' require "openid_redis_store"
# if you need to test this and are having ssl issues see: # if you need to test this and are having ssl issues see:
# http://stackoverflow.com/questions/6756460/openssl-error-using-omniauth-specified-ssl-path-but-didnt-work # http://stackoverflow.com/questions/6756460/openssl-error-using-omniauth-specified-ssl-path-but-didnt-work
@ -8,22 +8,22 @@ Rails.application.config.middleware.use OmniAuth::Builder do
provider :open_id, provider :open_id,
:store => OpenID::Store::Redis.new($redis), :store => OpenID::Store::Redis.new($redis),
:name => 'google', :name => "google",
:identifier => 'https://www.google.com/accounts/o8/id', :identifier => "https://www.google.com/accounts/o8/id",
:require => 'omniauth-openid' :require => "omniauth-openid"
provider :open_id, provider :open_id,
:store => OpenID::Store::Redis.new($redis), :store => OpenID::Store::Redis.new($redis),
:name => 'yahoo', :name => "yahoo",
:identifier => 'https://me.yahoo.com', :identifier => "https://me.yahoo.com",
:require => 'omniauth-openid' :require => "omniauth-openid"
Discourse.auth_providers.each do |p| Discourse.auth_providers.each do |p|
if p.type == :open_id if p.type == :open_id
provider :open_id, { provider :open_id, {
:name => p.name, :name => p.name,
:store => OpenID::Store::Redis.new($redis), :store => OpenID::Store::Redis.new($redis),
:require => 'omniauth-openid' :require => "omniauth-openid"
}.merge(p.options) }.merge(p.options)
end end
end end
@ -32,7 +32,7 @@ Rails.application.config.middleware.use OmniAuth::Builder do
# without it subdomains will not function correctly # without it subdomains will not function correctly
provider :facebook, provider :facebook,
:setup => lambda { |env| :setup => lambda { |env|
strategy = env['omniauth.strategy'] strategy = env["omniauth.strategy"]
strategy.options[:client_id] = SiteSetting.facebook_app_id strategy.options[:client_id] = SiteSetting.facebook_app_id
strategy.options[:client_secret] = SiteSetting.facebook_app_secret strategy.options[:client_secret] = SiteSetting.facebook_app_secret
}, },
@ -40,20 +40,21 @@ Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, provider :twitter,
:setup => lambda { |env| :setup => lambda { |env|
strategy = env['omniauth.strategy'] strategy = env["omniauth.strategy"]
strategy.options[:consumer_key] = SiteSetting.twitter_consumer_key strategy.options[:consumer_key] = SiteSetting.twitter_consumer_key
strategy.options[:consumer_secret] = SiteSetting.twitter_consumer_secret strategy.options[:consumer_secret] = SiteSetting.twitter_consumer_secret
} }
provider :github, provider :github,
:setup => lambda { |env| :setup => lambda { |env|
strategy = env['omniauth.strategy'] strategy = env["omniauth.strategy"]
strategy.options[:client_id] = SiteSetting.github_client_id strategy.options[:client_id] = SiteSetting.github_client_id
strategy.options[:client_secret] = SiteSetting.github_client_secret strategy.options[:client_secret] = SiteSetting.github_client_secret
} },
:scope => "email"
provider :browser_id, provider :browser_id,
:name => 'persona' :name => "persona"
provider :cas, provider :cas,
:host => SiteSetting.cas_hostname :host => SiteSetting.cas_hostname