<commit_before>require 'openssl'
require 'openid_redis_store'

# 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

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'

  provider :open_id,
           :store => OpenID::Store::Redis.new($redis),
           :name => 'yahoo',
           :identifier => 'https://me.yahoo.com',
           :require => 'omniauth-openid'

  Discourse.auth_providers.each do |p|
    if p.type == :open_id
      provider :open_id, {
        :name => p.name,
        :store => OpenID::Store::Redis.new($redis),
        :require => 'omniauth-openid'
      }.merge(p.options)
    end
  end

  # lambda is required for proper multisite support,
  #  without it subdomains will not function correctly
  provider :facebook,
           :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,
           :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,
           :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'

  provider :cas,
           :host => SiteSetting.cas_hostname

end<commit_msg>we need email scope (also as I edit files I like to keep quoting consistent)<commit_after>require "openssl"
require "openid_redis_store"

# 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

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"

  provider :open_id,
           :store => OpenID::Store::Redis.new($redis),
           :name => "yahoo",
           :identifier => "https://me.yahoo.com",
           :require => "omniauth-openid"

  Discourse.auth_providers.each do |p|
    if p.type == :open_id
      provider :open_id, {
        :name => p.name,
        :store => OpenID::Store::Redis.new($redis),
        :require => "omniauth-openid"
      }.merge(p.options)
    end
  end

  # lambda is required for proper multisite support,
  #  without it subdomains will not function correctly
  provider :facebook,
           :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,
           :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,
           :setup => lambda { |env|
              strategy = env["omniauth.strategy"]
              strategy.options[:client_id] = SiteSetting.github_client_id
              strategy.options[:client_secret] = SiteSetting.github_client_secret
           },
           :scope => "email"

  provider :browser_id,
           :name => "persona"

  provider :cas,
           :host => SiteSetting.cas_hostname

end
{'fraction_non_alphanumeric': 0.12082444918265814, 'fraction_numerical': 0.0037905709547500594, 'mean_word_length': 2.424168694241687, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 38, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '794657', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1221, 'n_words': 245}