Faster and simplified hash_secret() that directly produces urlsafe entries.

This commit is contained in:
Leo Vasanko
2026-02-18 23:02:36 +00:00
parent 228a103d73
commit 8f24f267c8
7 changed files with 19 additions and 26 deletions
+1 -2
View File
@@ -19,7 +19,6 @@ from collections.abc import AsyncGenerator
from datetime import UTC, datetime, timedelta
from uuid import UUID
import base64url
import httpx
import pytest
import pytest_asyncio
@@ -268,7 +267,7 @@ def create_test_session(
# Generate token and derive key
token = secrets.token_urlsafe(12)
key = base64url.enc(hash_secret("cookie", token))
key = hash_secret("cookie", token)
session = Session.create(
user=user_uuid,