Centralise all cookie handling to session.py.

This commit is contained in:
Leo Vasanko
2025-10-04 18:48:24 -06:00
parent 1ad1644b64
commit 07525b47ae
6 changed files with 43 additions and 50 deletions
+3 -3
View File
@@ -2,14 +2,14 @@ import logging
from functools import wraps
from uuid import UUID
from fastapi import Cookie, FastAPI, WebSocket, WebSocketDisconnect
from fastapi import FastAPI, WebSocket, WebSocketDisconnect
from webauthn.helpers.exceptions import InvalidAuthenticationResponse
from ..authsession import create_session, get_reset, get_session
from ..globals import db, passkey
from ..util import passphrase
from ..util.tokens import create_token, session_key
from .session import infodict
from .session import AUTH_COOKIE, infodict
# WebSocket error handling decorator
@@ -59,7 +59,7 @@ async def websocket_register_add(
ws: WebSocket,
reset: str | None = None,
name: str | None = None,
auth=Cookie(None, alias="__Host-auth"),
auth=AUTH_COOKIE,
):
"""Register a new credential for an existing user.