diff --git a/helpers/auth_guard.py b/helpers/auth_guard.py index 0a28c3d..900e35e 100644 --- a/helpers/auth_guard.py +++ b/helpers/auth_guard.py @@ -12,9 +12,9 @@ def admin_required(): def decorator(*args, **kwargs): verify_jwt_in_request() claims = get_jwt() - userId = claims["user_id"] - isAdmin = RoleService.is_user_admin(userId) - if isAdmin: + user_id = claims["user_id"] + is_admin = RoleService.is_user_admin(user_id) + if is_admin: return fn(*args, **kwargs) else: raise Unauthorized("You need to have admin permissions.")