Skip to content

BUG check time left to refresh token is always 0. _token_seconds function #6

@AdoNunes

Description

@AdoNunes

to whoever reads this:

Fix this line:
https://github.com/pattertj/ts-api/blob/4541c69feaf15527c9f2e110a395d46cca8a058b/ts/client/base.py#L251C1-L254C77

change it to:
token_exp = time.time() >= self._access_token_expires_at
token_time = int(self._access_token_expires_at - time.time())
# if the time to expiration is less than or equal to 0, return 0.
return 0 if not self._refresh_token or token_exp else token_time
otherwise it will always return 0 and every request with request a token refresh

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions