|
15 | 15 |
|
16 | 16 | from typing import TYPE_CHECKING, Any |
17 | 17 |
|
18 | | -from ..exceptions import raise_form_field_exception |
19 | | -from supertokens_python.recipe.emailpassword.interfaces import ( |
20 | | - SignUpOkResult, |
21 | | - SignUpPostEmailAlreadyExistsError, |
22 | | -) |
| 18 | +from supertokens_python.recipe.emailpassword.interfaces import SignUpPostOkResult |
23 | 19 | from supertokens_python.types import GeneralErrorResponse |
| 20 | + |
| 21 | +from ..exceptions import raise_form_field_exception |
24 | 22 | from ..types import ErrorFormField |
25 | 23 |
|
26 | 24 | if TYPE_CHECKING: |
@@ -51,17 +49,17 @@ async def handle_sign_up_api(api_implementation: APIInterface, api_options: APIO |
51 | 49 | form_fields, api_options, user_context |
52 | 50 | ) |
53 | 51 |
|
54 | | - if isinstance(response, SignUpOkResult): |
| 52 | + if isinstance(response, SignUpPostOkResult): |
55 | 53 | return send_200_response(response.to_json(), api_options.response) |
56 | 54 | if isinstance(response, GeneralErrorResponse): |
57 | 55 | return send_200_response(response.to_json(), api_options.response) |
58 | | - if isinstance(response, SignUpPostEmailAlreadyExistsError): |
59 | | - return raise_form_field_exception( |
60 | | - "EMAIL_ALREADY_EXISTS_ERROR", |
61 | | - [ |
62 | | - ErrorFormField( |
63 | | - id="email", |
64 | | - error="This email already exists. Please sign in instead.", |
65 | | - ) |
66 | | - ], |
67 | | - ) |
| 56 | + |
| 57 | + return raise_form_field_exception( |
| 58 | + "EMAIL_ALREADY_EXISTS_ERROR", |
| 59 | + [ |
| 60 | + ErrorFormField( |
| 61 | + id="email", |
| 62 | + error="This email already exists. Please sign in instead.", |
| 63 | + ) |
| 64 | + ], |
| 65 | + ) |
0 commit comments