Closed sdementen closed 4 years ago
Line https://github.com/Colin-b/requests_auth/blob/edcad63999610c79e34824a7c59dae32213a46d4/requests_auth/oauth2_tokens.py#L66 should be self._add_token(key, token, expiry.replace(tzinfo=datetime.timezone.utc).timestamp()) to get correct utc timestamp.
self._add_token(key, token, expiry.replace(tzinfo=datetime.timezone.utc).timestamp())
utcnow does not set tzinfo (see https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow) timestamp assume localtime of not tzinfo (see see https://docs.python.org/3/library/datetime.html#datetime.datetime.timestamp)
Will be fixed in next release (you can already retrieve the fix from develop branch).
Thanks for reporting !
Line https://github.com/Colin-b/requests_auth/blob/edcad63999610c79e34824a7c59dae32213a46d4/requests_auth/oauth2_tokens.py#L66 should be
self._add_token(key, token, expiry.replace(tzinfo=datetime.timezone.utc).timestamp())
to get correct utc timestamp.utcnow does not set tzinfo (see https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow) timestamp assume localtime of not tzinfo (see see https://docs.python.org/3/library/datetime.html#datetime.datetime.timestamp)