aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-01-07 19:57:48 -0800
committerAdam Soltys <[email protected]>2025-01-07 19:57:48 -0800
commit6cda2011da9e7fc53b728dacd023271604574f99 (patch)
tree30092942f4294af4ddada5a2000e3f7b19eaba9f
parent7220097de888b2a3cf9d0f82c149e770d1f1db6d (diff)
downloadcoinos-server-6cda2011da9e7fc53b728dacd023271604574f99.tar.gz
coinos-server-6cda2011da9e7fc53b728dacd023271604574f99.zip
remove salt and cipher
-rw-r--r--lib/nostr.ts4
-rw-r--r--lib/utils.ts2
-rw-r--r--lib/whitelist.ts2
-rw-r--r--routes/users.ts14
4 files changed, 4 insertions, 18 deletions
diff --git a/lib/nostr.ts b/lib/nostr.ts
index aa10f194..f3befa03 100644
--- a/lib/nostr.ts
+++ b/lib/nostr.ts
@@ -91,9 +91,9 @@ export async function handleZap(invoice) {
const r = await Relay.connect(url);
await r.publish(signed);
setTimeout(() => r.close(), 1000);
- } catch(e) {}
+ } catch (e) {}
});
- } catch(e) {
+ } catch (e) {
warn("failed to send receipt", e.message);
}
}
diff --git a/lib/utils.ts b/lib/utils.ts
index 61277b10..7dc6b9ef 100644
--- a/lib/utils.ts
+++ b/lib/utils.ts
@@ -51,11 +51,9 @@ export const bip21 = (address, { amount, memo, tip, type }) => {
};
export const fields = [
- "cipher",
"pubkey",
"password",
"username",
- "salt",
"currency",
"currencies",
"fiat",
diff --git a/lib/whitelist.ts b/lib/whitelist.ts
index 01e4ef72..07706432 100644
--- a/lib/whitelist.ts
+++ b/lib/whitelist.ts
@@ -5,7 +5,6 @@ export default [
"autowithdraw",
"balance",
"banner",
- "cipher",
"currencies",
"currency",
"destination",
@@ -36,7 +35,6 @@ export default [
"pubkey",
"push",
"reserve",
- "salt",
"seed",
"shopifyStore",
"shopifyToken",
diff --git a/routes/users.ts b/routes/users.ts
index 07354403..f67721b7 100644
--- a/routes/users.ts
+++ b/routes/users.ts
@@ -149,13 +149,7 @@ export default {
const ip = headers["cf-connecting-ip"];
if (!body.user) fail("no user object provided");
let { user } = body;
- const fields = [
- "cipher",
- "pubkey",
- "password",
- "username",
- "salt",
- ];
+ const fields = ["pubkey", "password", "username"];
user = await register(pick(user, fields), ip);
@@ -253,7 +247,6 @@ export default {
"about",
"autowithdraw",
"banner",
- "cipher",
"currencies",
"currency",
"destination",
@@ -271,7 +264,6 @@ export default {
"pubkey",
"push",
"reserve",
- "salt",
"seed",
"shopifyStore",
"shopifyToken",
@@ -374,7 +366,7 @@ export default {
let user = await getUser(key);
if (!user) {
const k0 = await getProfile(key);
- let username = k0?.name;
+ let username = k0?.name?.replace(/[^a-zA-Z0-9 ]/g, "");
const exists = await getUser(username);
if (exists) username = key.substr(0, 24);
@@ -558,8 +550,6 @@ export default {
try {
user.pin = null;
- user.cipher = null;
- user.salt = null;
if (user.nsec) {
const sk = randomBytes(32);