From f4aa6096abd8daf06fbfe6f9471340182d814bdf Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 14 Aug 2019 12:57:11 +0100 Subject: [PATCH] FIX: Convert omniauth authenticator names to symbols before comparing This is necessary because some auth plugins define their name as a string --- lib/middleware/omniauth_bypass_middleware.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/middleware/omniauth_bypass_middleware.rb b/lib/middleware/omniauth_bypass_middleware.rb index 92f3c97225d..4a3273071f5 100644 --- a/lib/middleware/omniauth_bypass_middleware.rb +++ b/lib/middleware/omniauth_bypass_middleware.rb @@ -28,7 +28,7 @@ class Middleware::OmniauthBypassMiddleware CSRFTokenVerifier.new.call(env) if request.request_method.downcase.to_sym != :get # Check whether the authenticator is enabled - if !Discourse.enabled_authenticators.any? { |a| a.name == env['omniauth.strategy'].name } + if !Discourse.enabled_authenticators.any? { |a| a.name.to_sym == env['omniauth.strategy'].name.to_sym } raise AuthenticatorDisabled end