diff --git a/api/controllers/service_api_with_auth/wraps.py b/api/controllers/service_api_with_auth/wraps.py index 753b660d7c..133c1f0d0c 100644 --- a/api/controllers/service_api_with_auth/wraps.py +++ b/api/controllers/service_api_with_auth/wraps.py @@ -66,7 +66,7 @@ def validate_user_token_and_extract_info(view: Optional[Callable] = None): raise Unauthorized("Invalid token: user not found") if account.status != AccountStatus.ACTIVE: raise Unauthorized("Invalid token: account is not active") - if account.current_role != TenantAccountJoinRole.END_USER: + if account.current_role != TenantAccountJoinRole.END_USER.value: raise Unauthorized("Invalid token: account is not end user") app_id = request.headers.get("X-App-Id")