From f2479c9c908234d051f8e57bec9f37ac43fe8dbf Mon Sep 17 00:00:00 2001 From: ImMin5 Date: Thu, 23 Nov 2023 16:02:17 +0900 Subject: [PATCH] fix: modify return value when check mfa verify_code (#64) --- src/spaceone/identity/manager/mfa_manager/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/spaceone/identity/manager/mfa_manager/__init__.py b/src/spaceone/identity/manager/mfa_manager/__init__.py index ea29ed6f..500baa99 100644 --- a/src/spaceone/identity/manager/mfa_manager/__init__.py +++ b/src/spaceone/identity/manager/mfa_manager/__init__.py @@ -6,6 +6,7 @@ from spaceone.core.manager import BaseManager from spaceone.identity.error.error_mfa import ERROR_NOT_SUPPORTED_MFA_TYPE +from spaceone.identity.error.error_user import ERROR_INVALID_VERIFY_CODE __all__ = ['BaseMFAManager', 'MFAManager'] _LOGGER = logging.getLogger(__name__) @@ -67,7 +68,7 @@ def check_mfa_verify_code(user_id, domain_id, verify_code): if cached_verify_code == verify_code: cache.delete(f'mfa-verify-code:{domain_id}:{user_id}') return True - return False + raise ERROR_INVALID_VERIFY_CODE(verify_code=verify_code) @staticmethod def _generate_verify_code():