B00TK1D / copilot-api

GitHub Copilot API
MIT License
123 stars 21 forks source link

Validate token expiration before API call #9

Closed gifflet closed 1 month ago

gifflet commented 2 months ago

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.