make somewhat anonymous, improve evaluation
All checks were successful
release-tag / release-image (push) Successful in 6m27s

This commit is contained in:
Matthias Weber
2024-07-10 21:31:55 +02:00
parent e4b2d04c7b
commit 566183dc4a
5 changed files with 33 additions and 39 deletions

View File

@@ -16,6 +16,8 @@ from starlette.middleware import Middleware
from starlette_context import plugins
from starlette_context.middleware import RawContextMiddleware
from hashlib import sha384
Base.metadata.create_all(engine)
if os.path.isfile("/tmp/first_run") and (os.environ.get("RELOAD_ON_FIRST_RUN", "").lower() == "true"):
@@ -58,7 +60,7 @@ async def vote(request: Request, session_id: str | None = None , unordered: bool
db: Session = Depends(get_db)) -> HTMLResponse:
if not session_id:
session_id = user["sub"]
session_id = sha384(str.encode(user["sub"])).hexdigest() #CryptContext(schemes=["bcrypt"], deprecated="auto").hash(user["sub"])
#print(user)