Fix user delete flow 9

This commit is contained in:
Urtzi Alfaro
2025-08-02 23:29:18 +02:00
parent 826df76029
commit abe74f32f8
6 changed files with 49 additions and 3 deletions

View File

@@ -99,6 +99,12 @@ class SecurityManager:
payload["is_verified"] = user_data["is_verified"]
if "is_active" in user_data:
payload["is_active"] = user_data["is_active"]
# ✅ CRITICAL FIX: Include role in access token!
if "role" in user_data:
payload["role"] = user_data["role"]
else:
payload["role"] = "user" # Default role if not specified
logger.debug(f"Creating access token with payload keys: {list(payload.keys())}")