Skip to content

Commit

Permalink
fixes bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhpoddar committed Oct 10, 2024
1 parent 81cf53d commit c1ec3c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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"]
Expand Down
8 changes: 4 additions & 4 deletions tests/test-server/test_functions_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def func(
):
if a.get("DO_NOT_LINK"):
return ShouldNotAutomaticallyLink()
if i.get("email") == "[email protected]" and l is None:
if i.email == "[email protected]" and l is None:
return ShouldNotAutomaticallyLink()
return ShouldAutomaticallyLink(should_require_verification=False)

Expand Down Expand Up @@ -101,17 +101,17 @@ async def func(
):
if a.get("DO_NOT_LINK"):
return ShouldNotAutomaticallyLink()
if i.get("email") == "[email protected]" and l is None:
if i.email == "[email protected]" and l is None:
return ShouldNotAutomaticallyLink()
return ShouldAutomaticallyLink(should_require_verification=True)

if (
'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()
Expand Down

0 comments on commit c1ec3c9

Please sign in to comment.