add status

This commit is contained in:
2025-08-17 21:23:02 -03:00
parent 39d9ff99fd
commit 401a81afa0
4 changed files with 11 additions and 4 deletions

View File

@@ -1,3 +1,4 @@
from datetime import timedelta
from http import HTTPStatus
from typing import Annotated
from uuid import uuid4
@@ -26,6 +27,7 @@ def session(
username: Annotated[str, Body()],
password: Annotated[str, Body()],
):
now_ = now()
user_id, password_hash = _get_user(username)
if not pbkdf2_sha256.verify(password, password_hash):
@@ -40,6 +42,7 @@ def session(
http_only=True,
secure=True,
same_site=None,
expires=now_ + timedelta(seconds=JWT_EXP_SECONDS),
)
],
)