File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -364,19 +364,20 @@ open class OAuth2: OAuth2Base {
364
364
365
365
perform ( request: post) { response in
366
366
do {
367
- let data = try response. responseData ( )
368
- let json = try self . parseRefreshTokenResponseData ( data)
369
367
let statusCode = response. response. statusCode
370
368
switch statusCode {
371
369
case 400 ..< 500 :
372
370
throw OAuth2Error . clientErrorWithStatus ( statusCode)
373
371
case 500 ... 599 :
374
372
throw OAuth2Error . serverErrorWithStatus ( statusCode)
373
+ case 200 ..< 300 :
374
+ let data = try response. responseData ( )
375
+ let json = try self . parseRefreshTokenResponseData ( data)
376
+ self . logger? . debug ( " OAuth2 " , msg: " Did use refresh token for access token [ \( nil != self . clientConfig. accessToken) ] " )
377
+ callback ( json, nil )
375
378
default :
376
379
throw OAuth2Error . generic ( " Failed with status \( response. response. statusCode) " )
377
380
}
378
- self . logger? . debug ( " OAuth2 " , msg: " Did use refresh token for access token [ \( nil != self . clientConfig. accessToken) ] " )
379
- callback ( json, nil )
380
381
}
381
382
catch let error {
382
383
self . logger? . debug ( " OAuth2 " , msg: " Error refreshing access token: \( error) " )
You can’t perform that action at this time.
0 commit comments