diff --git a/py/core/main/api/v3/users_router.py b/py/core/main/api/v3/users_router.py index 5a3e39949..4dd4c6c24 100644 --- a/py/core/main/api/v3/users_router.py +++ b/py/core/main/api/v3/users_router.py @@ -1828,6 +1828,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( @@ -1892,12 +1893,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",