From 3bddf981acc3cef1c549dfb1c38334db58c2d455 Mon Sep 17 00:00:00 2001 From: Mayank Thakur Date: Wed, 4 Oct 2023 18:39:17 +0530 Subject: [PATCH] Updated changelog --- CHANGELOG.md | 1 + supertokens_python/recipe/thirdparty/providers/github.py | 2 -- tests/thirdparty/{test_providers.py => test_thirdparty.py} | 0 3 files changed, 1 insertion(+), 2 deletions(-) rename tests/thirdparty/{test_providers.py => test_thirdparty.py} (100%) 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