From ead8406d805aba06fd2fec7481c6eb3dc1818431 Mon Sep 17 00:00:00 2001 From: KShivendu Date: Fri, 22 Sep 2023 12:40:42 +0530 Subject: [PATCH] fix: Twitter provider signup issue --- supertokens_python/recipe/thirdparty/api/implementation.py | 2 ++ supertokens_python/recipe/thirdparty/providers/twitter.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/supertokens_python/recipe/thirdparty/api/implementation.py b/supertokens_python/recipe/thirdparty/api/implementation.py index 2a79dce1f..6bf0a7c8c 100644 --- a/supertokens_python/recipe/thirdparty/api/implementation.py +++ b/supertokens_python/recipe/thirdparty/api/implementation.py @@ -86,6 +86,8 @@ async def sign_in_up_post( ) if user_info.email is None and provider.config.require_email is False: + # We don't expect to get an email from this provider. + # So we generate a fake one if provider.config.generate_fake_email is not None: user_info.email = UserInfoEmail( email=await provider.config.generate_fake_email( diff --git a/supertokens_python/recipe/thirdparty/providers/twitter.py b/supertokens_python/recipe/thirdparty/providers/twitter.py index d49ed47bc..bace8f67e 100644 --- a/supertokens_python/recipe/thirdparty/providers/twitter.py +++ b/supertokens_python/recipe/thirdparty/providers/twitter.py @@ -87,7 +87,7 @@ def Twitter(input: ProviderInput) -> Provider: # pylint: disable=redefined-buil input.config.user_info_endpoint = "https://api.twitter.com/2/users/me" if input.config.require_email is None: - input.config.require_email = True + input.config.require_email = False if input.config.user_info_map is None: input.config.user_info_map = UserInfoMap(UserFields(), UserFields())