aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-09-10 19:12:35 +0000
committerAdam Soltys <[email protected]>2025-09-10 19:12:36 +0000
commit90fa6509b2c403811ed91d65d8986f47bbecf243 (patch)
treee7a4c36e6e1ffb34b9d2d7ec0e339257dedf6962 /routes
parent59f42b98c944e6d062fb9d106b067584df21f4ff (diff)
downloadcoinos-server-90fa6509b2c403811ed91d65d8986f47bbecf243.tar.gz
coinos-server-90fa6509b2c403811ed91d65d8986f47bbecf243.zip
default account id
Diffstat (limited to 'routes')
-rw-r--r--routes/users.ts5
1 files changed, 3 insertions, 2 deletions
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");
}