This commit is contained in:
aaron 2025-03-06 14:39:50 +08:00
parent 78f0e9dd84
commit 61603f1981

View File

@ -16,6 +16,8 @@ def create_access_token(data: dict, expires_delta: Optional[timedelta] = None) -
else: else:
to_encode.update({"exp": datetime.now(timezone.utc) + timedelta(days=180)}) to_encode.update({"exp": datetime.now(timezone.utc) + timedelta(days=180)})
print(to_encode)
encoded_jwt = jwt.encode(to_encode, settings.SECRET_KEY, algorithm="HS256") encoded_jwt = jwt.encode(to_encode, settings.SECRET_KEY, algorithm="HS256")
return encoded_jwt return encoded_jwt