Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Findeton committed Jun 27, 2024
1 parent 74bd449 commit 29af7d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions iam/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ def __init__(self, token):
msg_split = self.msg.split(':')
self.timestamp = msg_split[-1]

self.is_access_token = len(msg_split) >= 4 and ACCESS_TOKEN_STR == msg_split[-2]
self.expiry_timestamp = msg_split[-3]
is_access_token = len(msg_split) >= 4 and ACCESS_TOKEN_STR == msg_split[-2]
self.expiry_timestamp = msg_split[-3] if is_access_token else False

if len(msg_split) >= 5:
self.userid = ':'.join(msg_split[0:-4])
Expand All @@ -247,7 +247,7 @@ def check_expiration(self, seconds=300):
returns true iff the token hasn't expired
'''
now = timezone.now()
if self.is_access_token:
if False != self.expiry_timestamp:
expiry_date = datetime.datetime.fromtimestamp(
int(self.expiry_timestamp),
tz=timezone.get_current_timezone()
Expand Down

0 comments on commit 29af7d6

Please sign in to comment.