From: Tom Hughes Date: Wed, 9 May 2012 09:14:58 +0000 (+0100) Subject: Use memcache to store temporary OpenID data X-Git-Tag: live~5545 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/f89dda9b906706da007e8185e8ffcd8a65ebac36 Use memcache to store temporary OpenID data OpenID nonces and associations need to be visible across all the servers in the production cluster, so store them in memcache where everything can see them properly. --- diff --git a/config/initializers/openid.rb b/config/initializers/openid.rb index 966164b3e..a171d1e7b 100644 --- a/config/initializers/openid.rb +++ b/config/initializers/openid.rb @@ -1 +1,7 @@ -OpenIdAuthentication.store = :file +if defined?(MEMCACHE_SERVERS) + require "openid/store/memcache" + + OpenIdAuthentication.store = OpenID::Store::Memcache.new(MemCache.new(:namespace => "rails", :string_return_types => true)) +else + OpenIdAuthentication.store = :file +end