Skip to content

Commit

Permalink
Fix: token refresh on session inactivity
Browse files Browse the repository at this point in the history
  • Loading branch information
kavya498 committed Aug 5, 2021
1 parent 186d413 commit 218aa38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (c *Client) MakeRequest(r *rest.Request, respV interface{}) (*gohttp.Respon
return new(gohttp.Response), err
}
if err != nil {
if ( resp.StatusCode == 401 || resp.StatusCode == 403) && c.TokenRefresher != nil {
if (resp.StatusCode == 401 || resp.StatusCode == 403 || (resp.StatusCode == 400 && strings.Contains(err.Error(), "BXNIM0439E") && strings.Contains(err.Error(), "invalidated due to inactivity"))) && c.TokenRefresher != nil {
log.Println("Authentication failed. Trying token refresh")
c.headerLock.Lock()
defer c.headerLock.Unlock()
Expand Down

0 comments on commit 218aa38

Please sign in to comment.