Hello! I was overriding implementation of ThirdPar...
# general
k
Hello! I was overriding implementation of ThirdPartyEmailPassword to deduplicate accounts and I just wanted to ask, if there's a particular reason to throw exception and handle it in
apis
and return
GENERAL_ERROR
instead of returning
SIGN_IN_UP_NOT_ALLOWED
in
functions
overrides? Is there a particular meaning or some kind of different handling in the frontend SDK for these two? The documentation: https://supertokens.com/docs/thirdpartyemailpassword/common-customizations/deduplication/implementing-deduplication The code I came up with - instead of throwing Error just like in the documentation, I return `SIGN_IN_UP_NOT_ALLOWED`:
Copy code
ts
return {
  status: "SIGN_IN_UP_NOT_ALLOWED",
  reason: `Cannot use this 3rd party for sign up.`,
};
r
They both have the same effect on the frontend wherein they both show the message in a red box on top of the pre built UI form. So you can use either. However, I would recommend sticking to GENERAL_ERROR cause thats what we assume people will use for this purpose. SIGN_IN_UP_NOT_ALLOWED is more for cases where our sdk wants to prevent sign in / up.
k
Alright. That's what I observed, but I guess separation of concerns is always a good thing to have. Thank you RP, as always!