mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
DEV: s/\$redis/Discourse\.redis (#8431)
This commit also adds a rubocop rule to prevent global variables.
This commit is contained in:
@ -30,7 +30,7 @@ class Auth::DefaultCurrentUserProvider
|
||||
|
||||
# bypass if we have the shared session header
|
||||
if shared_key = @env['HTTP_X_SHARED_SESSION_KEY']
|
||||
uid = $redis.get("shared_session_key_#{shared_key}")
|
||||
uid = Discourse.redis.get("shared_session_key_#{shared_key}")
|
||||
user = nil
|
||||
if uid
|
||||
user = User.find_by(id: uid.to_i)
|
||||
|
@ -87,7 +87,7 @@ class Auth::OpenIdAuthenticator < Auth::Authenticator
|
||||
omniauth.provider :open_id,
|
||||
setup: lambda { |env|
|
||||
strategy = env["omniauth.strategy"]
|
||||
strategy.options[:store] = OpenID::Store::Redis.new($redis)
|
||||
strategy.options[:store] = OpenID::Store::Redis.new(Discourse.redis)
|
||||
|
||||
# Add CSRF protection in addition to OpenID Specification
|
||||
def strategy.query_string
|
||||
|
Reference in New Issue
Block a user