]> git.openstreetmap.org Git - rails.git/blob - config/initializers/omniauth.rb
2f2245419dd711a9d681057af47afb9d30daef4e
[rails.git] / config / initializers / omniauth.rb
1 OmniAuth.config.logger = Rails.logger
2 OmniAuth.config.failure_raise_out_environments = []
3
4 if defined?(MEMCACHE_SERVERS)
5   require "openid/store/memcache"
6
7   openid_store = OpenID::Store::Memcache.new(Dalli::Client.new(MEMCACHE_SERVERS, :namespace => "rails"))
8 else
9   require "openid/store/filesystem"
10
11   openid_store = OpenID::Store::Filesystem.new(Rails.root.join("tmp/openids"))
12 end
13
14 Rails.application.config.middleware.use OmniAuth::Builder do
15   provider :openid, :name => "openid", :store => openid_store
16 end