|
27 | 27 | from supertokens_python.recipe.thirdparty.asyncio import ( |
28 | 28 | get_user_by_id as tp_get_user_by_idx, |
29 | 29 | ) |
| 30 | +from supertokens_python.recipe.thirdpartyemailpassword import ( |
| 31 | + ThirdPartyEmailPasswordRecipe, |
| 32 | +) |
30 | 33 | from supertokens_python.recipe.thirdpartyemailpassword.asyncio import ( |
31 | 34 | get_user_by_id as tpep_get_user_by_id, |
32 | 35 | ) |
| 36 | +from supertokens_python.recipe.thirdpartypasswordless import ( |
| 37 | + ThirdPartyPasswordlessRecipe, |
| 38 | +) |
33 | 39 | from supertokens_python.recipe.thirdpartypasswordless.asyncio import ( |
34 | 40 | get_user_by_id as tppless_get_user_by_id, |
35 | 41 | ) |
@@ -327,25 +333,55 @@ async def update_user_dict( |
327 | 333 |
|
328 | 334 |
|
329 | 335 | def is_recipe_initialised(recipeId: str) -> bool: |
| 336 | + isRecipeInitialised: bool = False |
| 337 | + |
330 | 338 | if recipeId == EmailPasswordRecipe.recipe_id: |
331 | 339 | try: |
332 | 340 | EmailPasswordRecipe.get_instance() |
333 | | - return True |
| 341 | + isRecipeInitialised = True |
334 | 342 | except Exception: |
335 | | - return False |
| 343 | + pass |
| 344 | + |
| 345 | + if not isRecipeInitialised: |
| 346 | + try: |
| 347 | + ThirdPartyEmailPasswordRecipe.get_instance() |
| 348 | + isRecipeInitialised = True |
| 349 | + except Exception: |
| 350 | + pass |
336 | 351 |
|
337 | 352 | elif recipeId == PasswordlessRecipe.recipe_id: |
338 | 353 | try: |
339 | 354 | PasswordlessRecipe.get_instance() |
340 | | - return True |
| 355 | + isRecipeInitialised = True |
341 | 356 | except Exception: |
342 | | - return False |
| 357 | + pass |
| 358 | + |
| 359 | + if not isRecipeInitialised: |
| 360 | + try: |
| 361 | + ThirdPartyPasswordlessRecipe.get_instance() |
| 362 | + isRecipeInitialised = True |
| 363 | + except Exception: |
| 364 | + pass |
343 | 365 |
|
344 | 366 | elif recipeId == ThirdPartyRecipe.recipe_id: |
345 | 367 | try: |
346 | 368 | ThirdPartyRecipe.get_instance() |
347 | | - return True |
| 369 | + isRecipeInitialised = True |
348 | 370 | except Exception: |
349 | | - return False |
| 371 | + pass |
350 | 372 |
|
351 | | - return False |
| 373 | + if not isRecipeInitialised: |
| 374 | + try: |
| 375 | + ThirdPartyEmailPasswordRecipe.get_instance() |
| 376 | + isRecipeInitialised = True |
| 377 | + except Exception: |
| 378 | + pass |
| 379 | + |
| 380 | + if not isRecipeInitialised: |
| 381 | + try: |
| 382 | + ThirdPartyPasswordlessRecipe.get_instance() |
| 383 | + isRecipeInitialised = True |
| 384 | + except Exception: |
| 385 | + pass |
| 386 | + |
| 387 | + return isRecipeInitialised |
0 commit comments