File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
lib/spark_api/authentication/oauth2_impl Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change
1
+ v1.5.5
2
+ - Add logging of an errored oauth2 response
3
+
1
4
v1.5.4
2
5
- Fix a problem with fetching counts with the http_method_override: true option supplied.
3
6
Original file line number Diff line number Diff line change 1
- 1.5.4
1
+ 1.5.5
Original file line number Diff line number Diff line change @@ -15,14 +15,18 @@ def initialize(app)
15
15
def on_complete ( env )
16
16
body = MultiJson . decode ( env [ :body ] )
17
17
SparkApi . logger . debug { "[oauth2] Response Body: #{ body . inspect } " }
18
+
18
19
unless body . is_a? ( Hash )
19
20
raise InvalidResponse , "The server response could not be understood"
20
21
end
22
+
21
23
case env [ :status ]
22
24
when 200 ..299
23
25
SparkApi . logger . debug { "[oauth2] Success!" }
24
26
session = OAuthSession . new ( body )
25
- else
27
+ else
28
+ SparkApi . logger . warn { "[oauth2] failure #{ body . inspect } " }
29
+
26
30
# Handle the WWW-Authenticate Response Header Field if present. This can be returned by
27
31
# OAuth2 implementations and wouldn't hurt to log.
28
32
auth_header_error = env [ :request_headers ] [ "WWW-Authenticate" ]
You can’t perform that action at this time.
0 commit comments