Skip to content

Commit

Permalink
fixes more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhpoddar committed Oct 1, 2024
1 parent cdcc4fc commit 61cfea3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/auth-react/flask-server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,8 @@ async def get_factors_setup_for_user(
user_context: Dict[str, Any],
):
res = await og_get_factors_setup_for_user(user, user_context)
if mfa_info.get("alreadySetup"):
return mfa_info.get("alreadySetup", [])
if "alreadySetup" in mfa_info:
return mfa_info["alreadySetup"]
return res

og_assert_allowed_to_setup_factor = (
Expand All @@ -843,7 +843,7 @@ async def assert_allowed_to_setup_factor_else_throw_invalid_claim_error(
factors_set_up_for_user: Callable[[], Awaitable[List[str]]],
user_context: Dict[str, Any],
):
if mfa_info.get("allowedToSetup"):
if "allowedToSetup" in mfa_info:
if factor_id not in mfa_info["allowedToSetup"]:
raise InvalidClaimsError(
msg="INVALID_CLAIMS",
Expand Down Expand Up @@ -884,7 +884,7 @@ async def get_mfa_requirements_for_auth(
required_secondary_factors_for_tenant,
user_context,
)
if mfa_info.get("requirements"):
if "requirements" in mfa_info:
return mfa_info["requirements"]
return res

Expand Down Expand Up @@ -914,10 +914,10 @@ async def resync_session_and_fetch_mfa_info_put(
)

if isinstance(res, ResyncSessionAndFetchMFAInfoPUTOkResult):
if mfa_info.get("alreadySetup"):
if "alreadySetup" in mfa_info:
res.factors.already_setup = mfa_info["alreadySetup"][:]

if mfa_info.get("noContacts"):
if "noContacts" in mfa_info:
res.emails = {}
res.phone_numbers = {}

Expand Down

0 comments on commit 61cfea3

Please sign in to comment.