Files
LMS/backend/app/security.py
T

52 lines
1.9 KiB
Python
Raw Normal View History

2026-03-31 14:15:32 +07:00
from datetime import datetime, timedelta, timezone
import os
2026-03-31 15:45:46 +07:00
import bcrypt
2026-03-31 14:15:32 +07:00
from jose import JWTError, jwt
# ── Config (override via environment variables) ───────────────────────────────
2026-04-02 10:21:52 +07:00
_raw_secret = os.getenv("JWT_SECRET_KEY", "")
if not _raw_secret:
import warnings
_raw_secret = "lms_dev_jwt_secret_change_in_production"
warnings.warn(
"JWT_SECRET_KEY is not set — using insecure default. "