From e2c9b0a1b2159bbb167a24d53852571bdcb01ecd Mon Sep 17 00:00:00 2001 From: Viraj Kanwade Date: Mon, 30 Dec 2024 20:48:09 -0800 Subject: [PATCH] fix: [#474] return raw_user_info_from_provider in get_user_info in github --- supertokens_python/recipe/thirdparty/providers/github.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/supertokens_python/recipe/thirdparty/providers/github.py b/supertokens_python/recipe/thirdparty/providers/github.py index 02105eac..39947807 100644 --- a/supertokens_python/recipe/thirdparty/providers/github.py +++ b/supertokens_python/recipe/thirdparty/providers/github.py @@ -24,6 +24,7 @@ from .custom import GenericProvider, NewProvider from ..provider import Provider, ProviderConfigForClient, ProviderInput +from ..types import RawUserInfoFromProvider class GithubImpl(GenericProvider): @@ -45,16 +46,18 @@ async def get_user_info( "Accept": "application/vnd.github.v3+json", } - raw_response = {} + raw_user_info_from_provider = RawUserInfoFromProvider({}, {}) email_info: List[Any] = await do_get_request("https://api.github.com/user/emails", headers=headers) # type: ignore user_info = await do_get_request("https://api.github.com/user", headers=headers) - raw_response["emails"] = email_info - raw_response["user"] = user_info + user_info["emails"] = email_info + raw_user_info_from_provider.from_user_info_api = user_info result = UserInfo( third_party_user_id=str(user_info.get("id")), + email=None, + raw_user_info_from_provider=raw_user_info_from_provider, ) for info in email_info: