diff options
| author | Adam Soltys <[email protected]> | 2025-02-20 10:58:59 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-02-20 10:58:59 -0800 |
| commit | 74eb7bab63581d948840dcdc99bb8e465861f072 (patch) | |
| tree | 87ee7f57b624ae07767a52d66262654e03fc6c57 /routes | |
| parent | 8e5395b7294e126fc54ef918ee16cf0036dd0089 (diff) | |
| download | coinos-server-74eb7bab63581d948840dcdc99bb8e465861f072.tar.gz coinos-server-74eb7bab63581d948840dcdc99bb8e465861f072.zip | |
trim pubkey
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/users.ts | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/routes/users.ts b/routes/users.ts index f7112591..52b9eef7 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -13,11 +13,9 @@ import upload from "$lib/upload"; import { bail, fail, fields, getUser, pick } from "$lib/utils"; import whitelist from "$lib/whitelist"; import rpc from "@coinos/rpc"; -import { randomBytes } from "@noble/hashes/utils"; import { $ } from "bun"; import jwt from "jsonwebtoken"; import { getPublicKey, nip19, verifyEvent } from "nostr-tools"; -import { encrypt as nip49encrypt } from "nostr-tools/nip49"; import { authenticator } from "otplib"; import { v4 } from "uuid"; @@ -172,6 +170,7 @@ export default { let { pubkey } = body; if (pubkey) { + pubkey = pubkey.trim(); exists = await getUser(pubkey); if (exists && ![username].includes(exists.username)) { warn("key in use", pubkey, exists.username); @@ -201,7 +200,6 @@ export default { if (user.pin === "delete") user.pin = undefined; if (username) { - let oldname; exists = await getUser(username); if (user.username.toLowerCase() !== username.toLowerCase() && exists) { @@ -212,7 +210,6 @@ export default { l("changing username", user.username, username); await db.del(`user:${user.username}`); - oldname = user.username; user.username = username; } } |
