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.

This commit is contained in:
Sam 2013-08-27 14:44:06 +10:00
parent 83d8bcdc27
commit bec463564f

View file

@ -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"