Motivation
The reauth functionality gets triggered at least every 12 Hours because the token expires. By using the "exp" field in the token, I can renew the token before making any unauthorized requests, reducing raised exceptions and preventing unnecessary requests.
Implementation
- Rewrite/Clean up the reauth functionality
- Parse the token with PyJWT or something similar
- Reauth a minuite before expiration to anticipate errors
- Give extra info in
exceptions.AuthenticationError if the token is expired
Motivation
The reauth functionality gets triggered at least every 12 Hours because the token expires. By using the "exp" field in the token, I can renew the token before making any unauthorized requests, reducing raised exceptions and preventing unnecessary requests.
Implementation
exceptions.AuthenticationErrorif the token is expired