diff --git a/CHANGELOG.md b/CHANGELOG.md index 6010d7119..a0a5ac5f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `validate_access_token` function to providers - This can be used to verify the access token received from providers. + - Implemented `validate_access_token` for the Github provider. ## [0.16.3] - 2023-09-28 diff --git a/supertokens_python/recipe/thirdparty/providers/github.py b/supertokens_python/recipe/thirdparty/providers/github.py index e14c03acc..81f9e86f1 100644 --- a/supertokens_python/recipe/thirdparty/providers/github.py +++ b/supertokens_python/recipe/thirdparty/providers/github.py @@ -90,7 +90,6 @@ async def validate_access_token( f"{config.client_id}:{client_secret}".encode() ).decode() - # POST request to get applications response url = f"https://api.github.com/applications/{config.client_id}/token" headers = { "Authorization": f"Basic {basic_auth_token}", @@ -100,7 +99,6 @@ async def validate_access_token( resp = requests.post(url, headers=headers, data=payload) - # Error handling and validation if resp.status_code != 200: raise ValueError("Invalid access token") diff --git a/tests/thirdparty/test_providers.py b/tests/thirdparty/test_thirdparty.py similarity index 100% rename from tests/thirdparty/test_providers.py rename to tests/thirdparty/test_thirdparty.py