From 90fa6509b2c403811ed91d65d8986f47bbecf243 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 10 Sep 2025 19:12:35 +0000 Subject: default account id --- routes/users.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'routes') diff --git a/routes/users.ts b/routes/users.ts index 82bff805..1338c50c 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -209,11 +209,12 @@ export default { pubkey = pubkey.trim(); if (pubkey.startsWith("npub")) pubkey = nip19.decode(pubkey).data; exists = await getUser(pubkey); + const un = user.username.toLowerCase().replace(/\s/g, ""); const existingUsername = exists?.username ?.toLowerCase() .replace(/\s/g, ""); - if (exists && username !== existingUsername) { - warn("key in use", pubkey, existingUsername); + if (exists && un !== existingUsername) { + warn("key in use", pubkey, username, existingUsername); if (exists.anon) await db.del(`user:${pubkey}`); else fail("Key in use by another account"); } -- cgit v1.2.3