Add New Passkey and Add New Device flows fixed.

This commit is contained in:
Leo Vasanko 2025-08-06 10:14:04 -06:00
parent 9f423135ed
commit 42545c07d2

View File

@ -114,14 +114,14 @@ async def websocket_register_add(ws: WebSocket, auth=Cookie(None)):
credential = await register_chat(
ws, user_uuid, user_name, challenge_ids, origin
)
if s.info["type"] == "authenticated":
token = auth
else:
if reset:
# Replace reset session with a new session
await db.instance.delete_session(s.key)
token = await create_session(
user_uuid, credential.uuid, infodict(ws, "authenticated")
)
else:
token = auth
assert isinstance(token, str) and len(token) == 16
# Store the new credential in the database
await db.instance.create_credential(credential)