|
1 | 1 | import os |
2 | | -from typing import Any, Dict, List, Union, Optional |
| 2 | +from typing import Any, Dict, List, Optional, Union |
3 | 3 |
|
4 | 4 | from dotenv import load_dotenv |
5 | 5 | from supertokens_python import InputAppInfo, Supertokens, SupertokensConfig, init |
6 | 6 | from supertokens_python.framework.request import BaseRequest |
7 | 7 | from supertokens_python.recipe import ( |
8 | 8 | emailpassword, |
| 9 | + emailverification, |
9 | 10 | passwordless, |
10 | 11 | session, |
11 | 12 | thirdparty, |
12 | 13 | thirdpartyemailpassword, |
13 | 14 | thirdpartypasswordless, |
14 | | - emailverification, |
15 | 15 | ) |
16 | 16 | from supertokens_python.recipe.emailpassword import EmailPasswordRecipe |
17 | 17 | from supertokens_python.recipe.emailpassword.interfaces import ( |
|
25 | 25 | InputFormField, |
26 | 26 | User, |
27 | 27 | ) |
28 | | -from supertokens_python.recipe.emailverification.types import User as EVUser |
29 | | -from supertokens_python.recipe.emailverification import ( |
30 | | - EmailVerificationRecipe, |
31 | | -) |
| 28 | +from supertokens_python.recipe.emailverification import EmailVerificationRecipe |
32 | 29 | from supertokens_python.recipe.emailverification import ( |
33 | 30 | InputOverrideConfig as EVInputOverrideConfig, |
34 | 31 | ) |
|
38 | 35 | from supertokens_python.recipe.emailverification.interfaces import ( |
39 | 36 | APIOptions as EVAPIOptions, |
40 | 37 | ) |
| 38 | +from supertokens_python.recipe.emailverification.types import User as EVUser |
41 | 39 | from supertokens_python.recipe.jwt import JWTRecipe |
42 | 40 | from supertokens_python.recipe.passwordless import ( |
43 | 41 | ContactEmailOnlyConfig, |
|
51 | 49 | APIInterface as PasswordlessAPIInterface, |
52 | 50 | ) |
53 | 51 | from supertokens_python.recipe.passwordless.interfaces import APIOptions as PAPIOptions |
54 | | -from supertokens_python.recipe.session import SessionRecipe, SessionContainer |
| 52 | +from supertokens_python.recipe.session import SessionContainer, SessionRecipe |
55 | 53 | from supertokens_python.recipe.session.interfaces import ( |
56 | 54 | APIInterface as SessionAPIInterface, |
57 | 55 | ) |
|
86 | 84 | from supertokens_python.types import GeneralErrorResponse |
87 | 85 | from typing_extensions import Literal |
88 | 86 |
|
89 | | -from .store import save_url_with_token, save_code |
| 87 | +from .store import save_code, save_url_with_token |
90 | 88 |
|
91 | 89 | load_dotenv() |
92 | 90 |
|
@@ -592,7 +590,7 @@ async def signout_post( |
592 | 590 | "body", api_options.request |
593 | 591 | ) |
594 | 592 | if is_general_error: |
595 | | - raise Exception("general error from signout API") |
| 593 | + return GeneralErrorResponse("general error from signout API") |
596 | 594 | return await original_signout_post(session, api_options, user_context) |
597 | 595 |
|
598 | 596 | original_implementation.signout_post = signout_post |
@@ -853,7 +851,7 @@ async def authorisation_url_get( |
853 | 851 | recipe_list = [ |
854 | 852 | session.init(override=session.InputOverrideConfig(apis=override_session_apis)), |
855 | 853 | emailverification.init( |
856 | | - mode="REQUIRED", |
| 854 | + mode="OPTIONAL", |
857 | 855 | create_and_send_custom_email=ev_create_and_send_custom_email, |
858 | 856 | override=EVInputOverrideConfig(apis=override_email_verification_apis), |
859 | 857 | ), |
|
0 commit comments