diff options
| author | Adam Soltys <[email protected]> | 2025-06-23 15:50:07 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-07-08 17:18:57 +0000 |
| commit | 8e5ac488b55d3fe84a5b8e4ba28310a9da2a6e0d (patch) | |
| tree | 46a7fa0477ab152cbf3ac90bcf7f2ecd139eb3e1 | |
| parent | 0ffadeb380f0f9bfec4b52f96ef5d362c1f3297b (diff) | |
| download | coinos-server-8e5ac488b55d3fe84a5b8e4ba28310a9da2a6e0d.tar.gz coinos-server-8e5ac488b55d3fe84a5b8e4ba28310a9da2a6e0d.zip | |
check username
| -rw-r--r-- | routes/users.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/routes/users.ts b/routes/users.ts index b28d34c6..c35d4b55 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -206,10 +206,8 @@ export default { if (pubkey) { pubkey = pubkey.trim(); exists = await getUser(pubkey); - const existingUsername = exists.username - .toLowerCase() - .replace(/\s/g, ""); - if (exists && ![username].includes(existingUsername)) { + let existingUsername = exists?.username?.toLowerCase().replace(/\s/g,""); + if (exists && username !== existingUsername) { warn("key in use", pubkey, existingUsername); if (exists.anon) await db.del(`user:${pubkey}`); else fail("Key in use by another account"); |
