From bec463564f79b98a7b171ab99af4d9d0d4759afe Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 27 Aug 2013 14:44:06 +1000 Subject: [PATCH] BUGFIX: When running under a forking server (apache or unicorn) openid strategy was caching a redis connection from the parent, this made "login with google" only work some of the time. --- lib/auth/open_id_authenticator.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/auth/open_id_authenticator.rb b/lib/auth/open_id_authenticator.rb index 77dec7b7e4..435a313ce5 100644 --- a/lib/auth/open_id_authenticator.rb +++ b/lib/auth/open_id_authenticator.rb @@ -50,7 +50,10 @@ class Auth::OpenIdAuthenticator < Auth::Authenticator def register_middleware(omniauth) omniauth.provider :open_id, - :store => OpenID::Store::Redis.new($redis), + :setup => lambda { |env| + strategy = env["omniauth.strategy"] + strategy.options[:store] = OpenID::Store::Redis.new($redis) + }, :name => name, :identifier => identifier, :require => "omniauth-openid"