|
14 | 14 | from __future__ import annotations
|
15 | 15 |
|
16 | 16 | from os import environ
|
17 |
| -from typing import TYPE_CHECKING, List, Union, Any, Dict, Callable, Optional, Awaitable |
| 17 | +from typing import TYPE_CHECKING, Any, Awaitable, Callable, Dict, List, Optional, Union |
18 | 18 |
|
19 | 19 | from supertokens_python.exceptions import SuperTokensError, raise_general_exception
|
20 | 20 | from supertokens_python.ingredients.emaildelivery import EmailDeliveryIngredient
|
21 | 21 | from supertokens_python.recipe.emailverification.exceptions import (
|
22 | 22 | EmailVerificationInvalidTokenError,
|
23 | 23 | )
|
24 | 24 | from supertokens_python.recipe.emailverification.types import (
|
| 25 | + EmailTemplateVars, |
25 | 26 | EmailVerificationIngredients,
|
| 27 | + User, |
26 | 28 | VerificationEmailTemplateVars,
|
27 | 29 | VerificationEmailTemplateVarsUser,
|
28 |
| - EmailTemplateVars, |
29 |
| - User, |
30 | 30 | )
|
31 | 31 | from supertokens_python.recipe_module import APIHandled, RecipeModule
|
32 |
| -from .ev_claim import EmailVerificationClaimValidators |
33 | 32 |
|
| 33 | +from ...ingredients.emaildelivery.types import EmailDeliveryConfig |
| 34 | +from ...logger import log_debug_message |
| 35 | +from ...post_init_callbacks import PostSTInitCallbacks |
| 36 | +from ..session import SessionRecipe |
| 37 | +from ..session.claim_base_classes.boolean_claim import BooleanClaim |
| 38 | +from ..session.interfaces import SessionContainer |
| 39 | +from .ev_claim import EmailVerificationClaimValidators |
34 | 40 | from .interfaces import (
|
| 41 | + APIInterface, |
35 | 42 | APIOptions,
|
36 |
| - UnknownUserIdError, |
37 |
| - TypeGetEmailForUserIdFunction, |
38 |
| - GetEmailForUserIdOkResult, |
| 43 | + CreateEmailVerificationTokenEmailAlreadyVerifiedError, |
39 | 44 | EmailDoesNotExistError,
|
40 |
| - APIInterface, |
41 |
| - EmailVerifyPostOkResult, |
42 | 45 | EmailVerifyPostInvalidTokenError,
|
43 |
| - VerifyEmailUsingTokenOkResult, |
44 |
| - IsEmailVerifiedGetOkResult, |
45 |
| - GenerateEmailVerifyTokenPostOkResult, |
| 46 | + EmailVerifyPostOkResult, |
46 | 47 | GenerateEmailVerifyTokenPostEmailAlreadyVerifiedError,
|
47 |
| - CreateEmailVerificationTokenEmailAlreadyVerifiedError, |
| 48 | + GenerateEmailVerifyTokenPostOkResult, |
| 49 | + GetEmailForUserIdOkResult, |
| 50 | + IsEmailVerifiedGetOkResult, |
| 51 | + TypeGetEmailForUserIdFunction, |
| 52 | + UnknownUserIdError, |
| 53 | + VerifyEmailUsingTokenOkResult, |
48 | 54 | )
|
49 | 55 | from .recipe_implementation import RecipeImplementation
|
50 |
| -from ..session import SessionRecipe |
51 |
| -from ..session.claim_base_classes.boolean_claim import BooleanClaim |
52 |
| -from ..session.interfaces import SessionContainer |
53 |
| -from ...ingredients.emaildelivery.types import EmailDeliveryConfig |
54 |
| -from ...logger import log_debug_message |
55 |
| -from ...post_init_callbacks import PostSTInitCallbacks |
56 | 56 |
|
57 | 57 | if TYPE_CHECKING:
|
58 | 58 | from supertokens_python.framework.request import BaseRequest
|
|
65 | 65 | from .api import handle_email_verify_api, handle_generate_email_verify_token_api
|
66 | 66 | from .constants import USER_EMAIL_VERIFY, USER_EMAIL_VERIFY_TOKEN
|
67 | 67 | from .exceptions import SuperTokensEmailVerificationError
|
68 |
| -from .utils import ( |
69 |
| - validate_and_normalise_user_input, |
70 |
| - MODE_TYPE, |
71 |
| - OverrideConfig, |
72 |
| -) |
| 68 | +from .utils import MODE_TYPE, OverrideConfig, validate_and_normalise_user_input |
73 | 69 |
|
74 | 70 |
|
75 | 71 | class EmailVerificationRecipe(RecipeModule):
|
@@ -332,7 +328,6 @@ async def is_email_verified_get(
|
332 | 328 | is_verified = await session.get_claim_value(
|
333 | 329 | EmailVerificationClaim, user_context
|
334 | 330 | )
|
335 |
| - # TODO: Type of is_verified should be bool. It's any for now. |
336 | 331 |
|
337 | 332 | if is_verified is None:
|
338 | 333 | raise Exception(
|
|
0 commit comments