|
1 | | -from __future__ import annotations |
2 | | - |
3 | 1 | import os |
4 | 2 | from typing import TYPE_CHECKING, Any, Dict, List, Optional, cast |
5 | 3 |
|
|
63 | 61 |
|
64 | 62 | if TYPE_CHECKING: |
65 | 63 | from supertokens_python.auth_utils import is_fake_email |
| 64 | + from supertokens_python.recipe.webauthn.interfaces.api import ( |
| 65 | + ApiInterface, |
| 66 | + APIOptions, |
| 67 | + TypeWebauthnEmailDeliveryInput, |
| 68 | + ) |
66 | 69 |
|
67 | 70 |
|
68 | 71 | class WebauthnRecipe(RecipeModule): |
69 | | - __instance: Optional[WebauthnRecipe] = None |
| 72 | + __instance: Optional["WebauthnRecipe"] = None |
70 | 73 | recipe_id = "webauthn" |
71 | 74 |
|
72 | 75 | config: NormalisedWebauthnConfig |
@@ -277,15 +280,15 @@ async def get_emails_for_factor( |
277 | 280 | PostSTInitCallbacks.add_post_init_callback(callback) |
278 | 281 |
|
279 | 282 | @staticmethod |
280 | | - def get_instance() -> WebauthnRecipe: |
| 283 | + def get_instance() -> "WebauthnRecipe": |
281 | 284 | if WebauthnRecipe.__instance is not None: |
282 | 285 | return WebauthnRecipe.__instance |
283 | 286 | raise_general_exception( |
284 | 287 | "Initialisation not done. Did you forget to call the SuperTokens.init function?" |
285 | 288 | ) |
286 | 289 |
|
287 | 290 | @staticmethod |
288 | | - def get_instance_optional() -> Optional[WebauthnRecipe]: |
| 291 | + def get_instance_optional() -> Optional["WebauthnRecipe"]: |
289 | 292 | return WebauthnRecipe.__instance |
290 | 293 |
|
291 | 294 | @staticmethod |
@@ -370,6 +373,7 @@ async def handle_api_request( |
370 | 373 | response: BaseResponse, |
371 | 374 | user_context: UserContext, |
372 | 375 | ) -> Optional[BaseResponse]: |
| 376 | + APIOptions.model_rebuild() |
373 | 377 | options = APIOptions( |
374 | 378 | config=self.config, |
375 | 379 | recipe_id=self.get_recipe_id(), |
|
0 commit comments