From f89dda9b906706da007e8185e8ffcd8a65ebac36 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 9 May 2012 10:14:58 +0100 Subject: [PATCH] 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. --- config/initializers/openid.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.43.2