Session sin expiracion, mostrar IP de red

This commit is contained in:
Lizandro Guarnizo
2026-06-17 18:10:06 -05:00
parent f040a01853
commit 5fb3e32d2f
4 changed files with 128 additions and 119 deletions
-1
View File
@@ -23,7 +23,6 @@ def create_token(user_id: int, username: str) -> str:
payload = {
"user_id": user_id,
"username": username,
"exp": datetime.utcnow() + timedelta(hours=ACCESS_TOKEN_EXPIRE_HOURS),
}
return jwt.encode(payload, SECRET_KEY, algorithm=ALGORITHM)
+1 -1
View File
@@ -68,7 +68,7 @@ async def login(
token = create_token(user["id"], user["username"])
resp = RedirectResponse("/dashboard", status_code=302)
resp.set_cookie(key="token", value=token, httponly=True, max_age=43200)
resp.set_cookie(key="token", value=token, httponly=True)
return resp
finally:
conn.close()