OAuth错误 - 无法确定此错误的确切原因

再次查看,oauth2_debug_auth 设置可能在服务器启动时生效,因为 oauth 中间件和调试日志记录器在该时间被附加。

def register_middleware(omniauth)
  omniauth.provider :oauth2_basic,
  ...
      opts[:client_options][:connection_build] = lambda do |builder|
        if SiteSetting.oauth2_debug_auth && defined?(OAuth2FaradayFormatter)
          builder.response :logger,
                         Rails.logger,
                         { bodies: true, formatter: OAuth2FaradayFormatter }
        end
  ...
    }
end

大多数站点设置不需要重启,但您需要重启服务器才能使此特定设置生效。


话虽如此,真正根本的问题是 Faraday::TimeoutError (Timeout::Error)。我认为我关闭日志的建议不会解决您的问题。您可能需要检查您的 Discourse 实例和 OAuth2 提供商之间的网络是否存在任何问题。