Skip to content

Commit

Permalink
fix: When a session is retired, make sure to also clear the access to…
Browse files Browse the repository at this point in the history
…ken. Refs #1090
  • Loading branch information
ecederstrand committed Aug 8, 2022
1 parent 5b6656d commit ead6019
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions exchangelib/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,9 @@ def release_session(self, session):
session = self.renew_session(session)
self._session_pool.put(session, block=False)

@staticmethod
def close_session(session):
def close_session(self, session):
if isinstance(self.credentials, OAuth2Credentials):
self.credentials.access_token = None
session.close()
del session

Expand Down

0 comments on commit ead6019

Please sign in to comment.