is it possible to use thirdparty/social-only login...
# support-questions-legacy
o
is it possible to use thirdparty/social-only login and not require the user's email?
r
Hey!
Are you using a custom social login provider?
o
nope
discord
it's built in into the python sdk
r
Right. So you need to override the getProfileInfo function from that provider to add some fake, but unique email to those who don’t have an email
And it should work fine
o
is there any validation of that email or can it just be @example.com?
r
It can be what you said
o
nice, thank you!
oh and
don't i need to override sign_in_up_post too?
since there seems to be some validation there too
r
Not really
o
Copy code
python
if email is None or email_verified is None:
    return SignInUpPostNoEmailGivenByProviderResponse()
because this ^ is in the implementation
r
So you can set the email to the random one you mentioned and set email_verified to true
As a return from the get profile info function
o
ooh i see
thank you!
Copy code
py
async def get_profile_info(self, auth_code_response, user_context):
    ...

provider_discord = Discord(
    ...
)
provider_discord.get_profile_info = get_profile_info
just to clarify, did you mean something like this when you said override?
r
yea pretty much.
you can copy over the original function from
provider_discord
and call that in your
get_profile_info
function.
And take the response from it, and if it has an email, then return it as is, else fill in the email object with the fake email
o
because thats giving me a very weird error, even when i just copy the get_profile_info from the provider
Copy code
return await handle_sign_in_up_api(self.api_implementation, api_options)

File "{path}/backend/venv/lib/python3.9/site-packages/supertokens_python/recipe/thirdparty/api/signinup.py", line 79, in handle_sign_in_up_api

  result = await api_implementation.sign_in_up_post(

File "{path}/backend/./main.py", line 27, in sign_in_up_post

  response = await original_sign_in_up_post(provider, code, redirect_uri, client_id, auth_code_response,

File "{path}/backend/venv/lib/python3.9/site-packages/supertokens_python/recipe/thirdparty/api/implementation.py", line 150, in sign_in_up_post

  user_info: UserInfo = await provider.get_profile_info(

TypeError: get_profile_info() missing 1 required positional argument: 'user_context'
oops, accidentally cut off the important part
r
remove the
self
arg
o
oooh
r
did it work?
o
sec
uhm
sorta
it didnt fail, but the database contains my email from before all of this, when the scope was still email, even though i deleted the user
oh and i've got to go in a sec so if i dont reply thats why
r
hmmm. Im not sure how that would be possible.. can you delete all the users and try again? Normally when you sign in / up with discord, the email for that user should get updated in the db
o
that’s the weird thing, I deleted all users and the database contains no entry relating to users anymore
only some jwt signing key
r
oh it could be that discord returns the email of the user since you had at one time accepted the email scope. So even if you remove it later, it gives you the email for that user.
o
that was it, thank you so much 😄
r
awesome
3 Views