feat: Funcion de sistema tenants

This commit is contained in:
2026-02-23 13:01:24 -07:00
parent ceea67eb2b
commit 1ccc39732b
58 changed files with 1889 additions and 315 deletions

View File

@@ -13,6 +13,7 @@ import pyotp
import secrets
import base64
import struct
import uuid
from app.core.config import get_settings
@@ -100,7 +101,8 @@ class SecurityUtils:
"""
to_encode = data.copy()
expire = datetime.utcnow() + timedelta(days=settings.REFRESH_TOKEN_EXPIRE_DAYS)
to_encode.update({"exp": expire, "type": "refresh"})
# Add a unique identifier so refresh tokens are never deterministic.
to_encode.update({"exp": expire, "type": "refresh", "jti": str(uuid.uuid4())})
encoded_jwt = jwt.encode(
to_encode,