supertokens-python icon indicating copy to clipboard operation
supertokens-python copied to clipboard

Bug: unexpected behavior with None by sign_up_post

Open igoose1 opened this issue 1 year ago • 4 comments

If emailpassword receipe's override doesn't return a Response instance in sign_up_post, supertokens-python responds with an unexpected error which is hard to debug.

In our case we needed to override sign_up_post in emailpassword receipt. By a developer's mistake, new sign_up_post wasn't returning anything when original_sign_up_post was an instance of emailpassword.interfaces.SignUpPostOkResult. Surprisingly, supertokens processed that without any warnings and errors. It responded with a FIELD_ERROR.

{"status":"FIELD_ERROR","formFields":[{"id":"email","error":"This email already exists. Please sign in instead."}]}

If it's important, a bug was caught on FastAPI and supertokens-python version is 0.12.9.

igoose1 avatar May 24 '23 12:05 igoose1