From 42545c07d20ac463268461f91301503a70b40a09 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Wed, 6 Aug 2025 10:14:04 -0600 Subject: [PATCH] Add New Passkey and Add New Device flows fixed. --- passkey/fastapi/ws.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/passkey/fastapi/ws.py b/passkey/fastapi/ws.py index 1ed569f..f3a851e 100644 --- a/passkey/fastapi/ws.py +++ b/passkey/fastapi/ws.py @@ -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)