From fa78755b4357a09c61107405580c36c9cc2e2fbb Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 9 Feb 2024 22:56:17 -0800 Subject: whitelist nsec --- routes/users.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'routes') diff --git a/routes/users.js b/routes/users.js index 8e2a0d14..97a0c9a7 100644 --- a/routes/users.js +++ b/routes/users.js @@ -195,6 +195,7 @@ export default { password, pin, newpin, + pubkey, username, shopifyToken, shopifyStore, @@ -220,6 +221,13 @@ export default { user.username = username; } + if (pubkey) exists = await getUser(pubkey); + if (username !== exists.username) { + warn("key in use", pubkey, exists.username); + if (exists.anon) await db.del(`user:${pubkey}`); + else fail("Key in use by another account"); + } + let attributes = [ "address", "autowithdraw", @@ -235,6 +243,7 @@ export default { "locktime", "nip5", "notify", + "nsec", "prompt", "profile", "pubkey", -- cgit v1.2.3