From bd861d273cfe71d36753dde9429aa30b93e63da8 Mon Sep 17 00:00:00 2001 From: emrgnt-cmplxty Date: Thu, 9 Jan 2025 19:55:51 -0800 Subject: [PATCH] up --- py/core/main/api/v3/users_router.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py/core/main/api/v3/users_router.py b/py/core/main/api/v3/users_router.py index 9ecb1855f..1371cc246 100644 --- a/py/core/main/api/v3/users_router.py +++ b/py/core/main/api/v3/users_router.py @@ -1831,6 +1831,7 @@ async def google_callback( # id_info will contain "sub", "email", etc. google_id = id_info["sub"] email = id_info.get("email") + email = email or f"{google_id}@google_oauth.fake" # 3. Now call our R2RAuthProvider method that handles "oauth-based" user creation or login token_response = await self.providers.auth.oauth_callback_handler( @@ -1895,12 +1896,13 @@ async def github_callback( "https://api.github.com/user", headers={"Authorization": f"Bearer {access_token}"}, ).json() + github_id = str( user_info_resp["id"] ) # GitHub user ID is typically an integer # fetch email (sometimes you need to call /user/emails endpoint if user sets email private) email = user_info_resp.get("email") - + email = email or f"{github_id}@github_oauth.fake" # 3. Pass to your auth provider token_response = await self.providers.auth.oauth_callback_handler( provider="github",