We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2f25c50 commit b60d1f8Copy full SHA for b60d1f8
lib/glogin/auth.rb
@@ -67,9 +67,12 @@ def user(code)
67
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
68
req = Net::HTTP::Get.new(uri.request_uri)
69
req['Accept-Header'] = 'application/json'
70
- req['Authorization'] = "token #{access_token(code)}"
+ token = access_token(code)
71
+ req['Authorization'] = "token #{token}"
72
res = http.request(req)
- raise "Error (#{res.code}): #{res.body}" unless res.code == '200'
73
+ unless res.code == '200'
74
+ raise "Error (#{res.code}) with token #{token[0..6]}#{'*' * (token.length - 6)}: #{res.body}"
75
+ end
76
JSON.parse(res.body)
77
end
78
0 commit comments