Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions demo_client/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ async def register_passkey(self):
)

try:
handle = window_handle[window_handle.find(":") + 1 :]
toplevel.unexport_handle(handle)
if isinstance(toplevel, GdkWayland.WaylandToplevel):
toplevel.drop_exported_handle(handle)
except Exception as err:
print(err)

Expand Down Expand Up @@ -263,15 +263,24 @@ async def assert_passkey(self):
username = self.username.get_text()
if username:
print(f"Using username-flow: {username}")
sql = """
db = connect_db()
get_user_sql = """
select user_id from users u
where u.username = ?
"""

get_user_creds_sql = """
select p.user_handle, cred_id, backup_eligible, backup_state, cose_pub_key, sign_count
from user_passkeys p
inner join users u on u.user_handle = p.user_handle
where u.username = ?
"""
db = connect_db()
with closing(db.cursor()) as cur:
cur.execute(sql, (username,))
cur.execute(get_user_sql, (username,))
if not cur.fetchone():
raise Exception(f"No account found for username: {username}")

cur.execute(get_user_creds_sql, (username,))
user_creds = []
for row in cur.fetchall():
[
Expand Down
Loading