Centralise all cookie handling to session.py.

This commit is contained in:
2025-10-05 06:48:24 +00:00
parent 7247f7c584
commit c218ddad61
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.