Skip to content

Commit

Permalink
fix(gmail) token expiry calculation is wrong (#2381)
Browse files Browse the repository at this point in the history
  • Loading branch information
marwoodandrew authored Sep 22, 2022
1 parent c3b3cc4 commit bf1a30c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion superdesk/io/feeding_services/gmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def authenticate(self, provider: dict, config: dict) -> imaplib.IMAP4_SSL:
raise IngestEmailError.notConfiguredError(ValueError(l_("You need to log in first")), provider=provider)
imap = imaplib.IMAP4_SSL("imap.gmail.com")

if token["expires_at"].timestamp() < time.time() + 600:
if token["expires_at"].replace(tzinfo=None).timestamp() < time.time() + 600:
logger.info("Refreshing token for {provider_name}".format(provider_name=provider["name"]))
token = oauth.refresh_google_token(token["_id"])

Expand Down

0 comments on commit bf1a30c

Please sign in to comment.