diff --git a/supertokens_python/recipe/accountlinking/recipe_implementation.py b/supertokens_python/recipe/accountlinking/recipe_implementation.py index ef156e39..5d4495c5 100644 --- a/supertokens_python/recipe/accountlinking/recipe_implementation.py +++ b/supertokens_python/recipe/accountlinking/recipe_implementation.py @@ -118,7 +118,7 @@ async def can_create_primary_user( ) elif ( response["status"] - == "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_PRIMARY_USER_ID_ERROR" + == "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" ): return CanCreatePrimaryUserAccountInfoAlreadyAssociatedError( response["primaryUserId"], response["description"] @@ -155,7 +155,7 @@ async def create_primary_user( ) elif ( response["status"] - == "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_PRIMARY_USER_ID_ERROR" + == "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" ): return CreatePrimaryUserAccountInfoAlreadyAssociatedError( response["primaryUserId"], response["description"] @@ -194,7 +194,7 @@ async def can_link_accounts( ) elif ( response["status"] - == "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_PRIMARY_USER_ID_ERROR" + == "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" ): return CanLinkAccountsAccountInfoAlreadyAssociatedError( response["primaryUserId"], response["description"] diff --git a/tests/test-server/test_functions_mapper.py b/tests/test-server/test_functions_mapper.py index 63f32d0f..3b744410 100644 --- a/tests/test-server/test_functions_mapper.py +++ b/tests/test-server/test_functions_mapper.py @@ -71,7 +71,7 @@ async def func( ): if a.get("DO_NOT_LINK"): return ShouldNotAutomaticallyLink() - if i.get("email") == "test2@example.com" and l is None: + if i.email == "test2@example.com" and l is None: return ShouldNotAutomaticallyLink() return ShouldAutomaticallyLink(should_require_verification=False) @@ -101,7 +101,7 @@ async def func( ): if a.get("DO_NOT_LINK"): return ShouldNotAutomaticallyLink() - if i.get("email") == "test2@example.com" and l is None: + if i.email == "test2@example.com" and l is None: return ShouldNotAutomaticallyLink() return ShouldAutomaticallyLink(should_require_verification=True) @@ -109,9 +109,9 @@ async def func( 'async(i,e)=>{if("emailpassword"===i.recipeId){if(!((await supertokens.listUsersByAccountInfo("public",{email:i.email})).length>1))return{shouldAutomaticallyLink:!1}}return{shouldAutomaticallyLink:!0,shouldRequireVerification:!0}}' in eval_str ): - if i.get("recipeId") == "emailpassword": + if i.recipe_id == "emailpassword": users = await list_users_by_account_info( - "public", AccountInfo(email=i.get("email")) + "public", AccountInfo(email=i.email) ) if len(users) <= 1: return ShouldNotAutomaticallyLink()