Skip to content

Commit c0ea957

Browse files
authored
Explain the reason of this subtle change
1 parent 0075528 commit c0ea957

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

msal/token_cache.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,11 @@ def add(self, event, now=None):
128128
with self._lock:
129129

130130
if access_token:
131-
now = int(time.time()) if now is None else int(now)
132-
expires_in = int(response.get("expires_in", 3599))
133-
ext_expires_in = int(response.get("ext_expires_in", expires_in))
131+
now = int(time.time() if now is None else now)
132+
expires_in = int( # AADv1-like endpoint returns a string
133+
response.get("expires_in", 3599))
134+
ext_expires_in = int( # AADv1-like endpoint returns a string
135+
response.get("ext_expires_in", expires_in))
134136
at = {
135137
"credential_type": self.CredentialType.ACCESS_TOKEN,
136138
"secret": access_token,

0 commit comments

Comments
 (0)