-
Notifications
You must be signed in to change notification settings - Fork 119
DEV: Improve logging and fix some formatting errors #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
@@ -50,7 +50,7 @@ def recurse(obj, keys) | |
class OAuth2FaradayFormatter < Faraday::Logging::Formatter | ||
def request(env) | ||
warn <<~LOG | ||
OAuth2 Debugging: request #{env.method.upcase} #{env.url.to_s} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rubocop error |
||
OAuth2 Debugging: request #{env.method.upcase} #{env.url} | ||
|
||
Headers: | ||
#{env.request_headers.to_yaml} | ||
|
@@ -64,7 +64,7 @@ def response(env) | |
warn <<~LOG | ||
OAuth2 Debugging: response status #{env.status} | ||
|
||
From #{env.method.upcase} #{env.url.to_s} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rubocop error |
||
From #{env.method.upcase} #{env.url} | ||
|
||
Headers: | ||
#{env.request_headers.to_yaml} | ||
|
@@ -236,8 +236,12 @@ def fetch_user_details(token, id) | |
log <<-LOG | ||
user_json request: #{user_json_method} #{user_json_url} | ||
|
||
response: | ||
#{user_json_response.to_yaml} | ||
request headers: #{headers} | ||
|
||
response status: #{user_json_response.status} | ||
|
||
response body: | ||
#{user_json_response.body} | ||
Comment on lines
+239
to
+244
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Things added to the logs |
||
LOG | ||
|
||
if user_json_response.status == 200 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax tree error