diff --git a/tests/auth-react/flask-server/app.py b/tests/auth-react/flask-server/app.py index 91318365..0af55857 100644 --- a/tests/auth-react/flask-server/app.py +++ b/tests/auth-react/flask-server/app.py @@ -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 = ( @@ -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", @@ -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 @@ -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 = {}