This PR enhances the token management in api.py by adding validation for token expiration before making API calls. The newly introduced helper functions is_token_invalid and extract_exp_value ensure that the token is valid and not expired. This change improves the reliability and stability of the API by preventing unauthorized requests due to expired tokens.
This PR enhances the token management in api.py by adding validation for token expiration before making API calls. The newly introduced helper functions is_token_invalid and extract_exp_value ensure that the token is valid and not expired. This change improves the reliability and stability of the API by preventing unauthorized requests due to expired tokens.