Skip to content

Commit

Permalink
remove Auth header on InvalidToken exception
Browse files Browse the repository at this point in the history
  • Loading branch information
bug-or-feature authored Dec 4, 2023
1 parent 8891c0d commit e99f212
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions trading_ig/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def create(self, endpoint, params, session, version):
raise ApiExceededException()
if token_invalid(response.text):
logger.warning("Invalid session token, triggering refresh...")
del self.session.headers["Authorization"]
raise TokenInvalidException()
if "error.public-api.failure.kyc.required" in response.text:
raise KycRequiredException(
Expand Down

0 comments on commit e99f212

Please sign in to comment.