[BUG] Tokens expiring too fast
Closed this issue · 0 comments
geogamba commented
Describe the bug
The token expiration conversion of seconds to microseconds is incorrect. I've been having problems with tokens expiring too fast, and narrowed it down to this problem.
Currently on core.py
line 2281
def expired(self) -> bool:
""" """
return self.timestamp + (self.expires_in - TokenProvider.
token_expire_threshold) * 1000 < int(
time.time_ns() / 1000)
it should be
def expired(self) -> bool:
""" """
return self.timestamp + (self.expires_in - TokenProvider.
token_expire_threshold) * 1000000 < int(
time.time_ns() / 1000)
This should convert seconds to microseconds to match the self.timestamp
and the time.time_ns() / 1000
(nanosecond converted to microseconds)
To Reproduce
Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Client Information (please complete the following information):
- OS: [e.g. Windows]
- Python Version [e.g. 3.9.0]
- Library Version [e.g. 0.0.1]
Additional context
Add any other context about the problem here.