@@ -55,9 +55,15 @@ <h1 class="title">Module <code>supertokens_python.recipe.dashboard.utils</code><
55
55
from supertokens_python.recipe.thirdparty.asyncio import (
56
56
get_user_by_id as tp_get_user_by_idx,
57
57
)
58
+ from supertokens_python.recipe.thirdpartyemailpassword import (
59
+ ThirdPartyEmailPasswordRecipe,
60
+ )
58
61
from supertokens_python.recipe.thirdpartyemailpassword.asyncio import (
59
62
get_user_by_id as tpep_get_user_by_id,
60
63
)
64
+ from supertokens_python.recipe.thirdpartypasswordless import (
65
+ ThirdPartyPasswordlessRecipe,
66
+ )
61
67
from supertokens_python.recipe.thirdpartypasswordless.asyncio import (
62
68
get_user_by_id as tppless_get_user_by_id,
63
69
)
@@ -351,7 +357,62 @@ <h1 class="title">Module <code>supertokens_python.recipe.dashboard.utils</code><
351
357
if user is not None and recipe is not None:
352
358
return GetUserForRecipeIdResult(user, recipe)
353
359
354
- return None</ code > </ pre >
360
+ return None
361
+
362
+
363
+ def is_recipe_initialised(recipeId: str) -> bool:
364
+ isRecipeInitialised: bool = False
365
+
366
+ if recipeId == EmailPasswordRecipe.recipe_id:
367
+ try:
368
+ EmailPasswordRecipe.get_instance()
369
+ isRecipeInitialised = True
370
+ except Exception:
371
+ pass
372
+
373
+ if not isRecipeInitialised:
374
+ try:
375
+ ThirdPartyEmailPasswordRecipe.get_instance()
376
+ isRecipeInitialised = True
377
+ except Exception:
378
+ pass
379
+
380
+ elif recipeId == PasswordlessRecipe.recipe_id:
381
+ try:
382
+ PasswordlessRecipe.get_instance()
383
+ isRecipeInitialised = True
384
+ except Exception:
385
+ pass
386
+
387
+ if not isRecipeInitialised:
388
+ try:
389
+ ThirdPartyPasswordlessRecipe.get_instance()
390
+ isRecipeInitialised = True
391
+ except Exception:
392
+ pass
393
+
394
+ elif recipeId == ThirdPartyRecipe.recipe_id:
395
+ try:
396
+ ThirdPartyRecipe.get_instance()
397
+ isRecipeInitialised = True
398
+ except Exception:
399
+ pass
400
+
401
+ if not isRecipeInitialised:
402
+ try:
403
+ ThirdPartyEmailPasswordRecipe.get_instance()
404
+ isRecipeInitialised = True
405
+ except Exception:
406
+ pass
407
+
408
+ if not isRecipeInitialised:
409
+ try:
410
+ ThirdPartyPasswordlessRecipe.get_instance()
411
+ isRecipeInitialised = True
412
+ except Exception:
413
+ pass
414
+
415
+ return isRecipeInitialised</ code > </ pre >
355
416
</ details >
356
417
</ section >
357
418
< section >
@@ -499,6 +560,70 @@ <h2 class="section-title" id="header-functions">Functions</h2>
499
560
return False</ code > </ pre >
500
561
</ details >
501
562
</ dd >
563
+ < dt id ="supertokens_python.recipe.dashboard.utils.is_recipe_initialised "> < code class ="name flex ">
564
+ < span > def < span class ="ident "> is_recipe_initialised</ span > </ span > (< span > recipeId: str) ‑> bool</ span >
565
+ </ code > </ dt >
566
+ < dd >
567
+ < div class ="desc "> </ div >
568
+ < details class ="source ">
569
+ < summary >
570
+ < span > Expand source code</ span >
571
+ </ summary >
572
+ < pre > < code class ="python "> def is_recipe_initialised(recipeId: str) -> bool:
573
+ isRecipeInitialised: bool = False
574
+
575
+ if recipeId == EmailPasswordRecipe.recipe_id:
576
+ try:
577
+ EmailPasswordRecipe.get_instance()
578
+ isRecipeInitialised = True
579
+ except Exception:
580
+ pass
581
+
582
+ if not isRecipeInitialised:
583
+ try:
584
+ ThirdPartyEmailPasswordRecipe.get_instance()
585
+ isRecipeInitialised = True
586
+ except Exception:
587
+ pass
588
+
589
+ elif recipeId == PasswordlessRecipe.recipe_id:
590
+ try:
591
+ PasswordlessRecipe.get_instance()
592
+ isRecipeInitialised = True
593
+ except Exception:
594
+ pass
595
+
596
+ if not isRecipeInitialised:
597
+ try:
598
+ ThirdPartyPasswordlessRecipe.get_instance()
599
+ isRecipeInitialised = True
600
+ except Exception:
601
+ pass
602
+
603
+ elif recipeId == ThirdPartyRecipe.recipe_id:
604
+ try:
605
+ ThirdPartyRecipe.get_instance()
606
+ isRecipeInitialised = True
607
+ except Exception:
608
+ pass
609
+
610
+ if not isRecipeInitialised:
611
+ try:
612
+ ThirdPartyEmailPasswordRecipe.get_instance()
613
+ isRecipeInitialised = True
614
+ except Exception:
615
+ pass
616
+
617
+ if not isRecipeInitialised:
618
+ try:
619
+ ThirdPartyPasswordlessRecipe.get_instance()
620
+ isRecipeInitialised = True
621
+ except Exception:
622
+ pass
623
+
624
+ return isRecipeInitialised</ code > </ pre >
625
+ </ details >
626
+ </ dd >
502
627
< dt id ="supertokens_python.recipe.dashboard.utils.is_valid_recipe_id "> < code class ="name flex ">
503
628
< span > def < span class ="ident "> is_valid_recipe_id</ span > </ span > (< span > recipe_id: str) ‑> bool</ span >
504
629
</ code > </ dt >
@@ -865,6 +990,7 @@ <h2>Index</h2>
865
990
< li > < code > < a title ="supertokens_python.recipe.dashboard.utils.get_api_if_matched " href ="#supertokens_python.recipe.dashboard.utils.get_api_if_matched "> get_api_if_matched</ a > </ code > </ li >
866
991
< li > < code > < a title ="supertokens_python.recipe.dashboard.utils.get_user_for_recipe_id " href ="#supertokens_python.recipe.dashboard.utils.get_user_for_recipe_id "> get_user_for_recipe_id</ a > </ code > </ li >
867
992
< li > < code > < a title ="supertokens_python.recipe.dashboard.utils.is_api_path " href ="#supertokens_python.recipe.dashboard.utils.is_api_path "> is_api_path</ a > </ code > </ li >
993
+ < li > < code > < a title ="supertokens_python.recipe.dashboard.utils.is_recipe_initialised " href ="#supertokens_python.recipe.dashboard.utils.is_recipe_initialised "> is_recipe_initialised</ a > </ code > </ li >
868
994
< li > < code > < a title ="supertokens_python.recipe.dashboard.utils.is_valid_recipe_id " href ="#supertokens_python.recipe.dashboard.utils.is_valid_recipe_id "> is_valid_recipe_id</ a > </ code > </ li >
869
995
< li > < code > < a title ="supertokens_python.recipe.dashboard.utils.validate_and_normalise_user_input " href ="#supertokens_python.recipe.dashboard.utils.validate_and_normalise_user_input "> validate_and_normalise_user_input</ a > </ code > </ li >
870
996
</ ul >
0 commit comments