https://supertokens.com/ logo
y

yiannis.gkoufas

04/16/2022, 5:59 PM
Hi everyone, I was wondering something about the 3rd party + email recipe. let's say someone uses google signin and then tries to signup using the same email address. I notice that in the database there are 2 users created with the same email (and different userids ofcourse) is it possible to configure supertokens to prevent that? I would like to use the email as user id and when the user tries to signup with the same gmail address to get an error about they are being already registered
r

rp

04/16/2022, 6:00 PM
Hey!
Yes. It’s possible to do that. You can use the override feature on the sign up API to check if the email already exists in third party, and if it does, return an email already exists status code
y

yiannis.gkoufas

04/16/2022, 6:03 PM
oh that's great! do you have the link handy with the documentation for this flag?
r

rp

04/16/2022, 6:04 PM
It’s not really a flag, you will have to add some logic for this yourself. Check out the advanced customisation section -> api override
y

yiannis.gkoufas

04/16/2022, 6:06 PM
in which recipe is this?
r

rp

04/16/2022, 6:07 PM
Yup
y

yiannis.gkoufas

04/16/2022, 6:08 PM
perfect! thanks! and the status codes I assume are in the sdk reference?
r

rp

04/16/2022, 6:09 PM
You can see the return type of the function and return an appropriate status
y

yiannis.gkoufas

04/16/2022, 6:11 PM
awesome, thanks @rp !
7 Views