From 6e3b0b62ff9d3c9c4b4c6b1c390737aa16b2ff61 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Tue, 9 Jan 2024 10:40:16 +0800 Subject: [PATCH] DEV: Log more information for user json response Why this change? Currently we are only logging the `Faraday::Response` object which is not very useful because it doesn't show the response status code. --- plugin.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.rb b/plugin.rb index 025e903..0148f7d 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # name: discourse-oauth2-basic -# about: Allows users to login to your forum using a basic OAuth2 provider. +# about: Allows users to login to your forum using a basic OAuth2 provider. # meta_topic_id: 33879 # version: 0.3 # authors: Robin Ward @@ -231,7 +231,7 @@ class ::OAuth2BasicAuthenticator < Auth::ManagedAuthenticator headers = { "Authorization" => bearer_token, "Accept" => "application/json" } user_json_response = connection.run_request(user_json_method, user_json_url, nil, headers) - log("user_json_response: #{user_json_response.inspect}") + log("user_json_response: (#{user_json_response.status}) #{user_json_response.inspect}") if user_json_response.status == 200 user_json = JSON.parse(user_json_response.body)