aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-03-14 17:12:37 +0000
committerAdam Soltys <[email protected]>2026-03-14 17:12:37 +0000
commitf87b082c14869c4934b4e5fc7ff4b8066a84ed8d (patch)
treeb4a83b6e0ba9c9cbe583baefc5215557ba0d4b11
parentfa5188d7e4781e90d1f315274f840f60db326f7e (diff)
downloadcoinos-server-f87b082c14869c4934b4e5fc7ff4b8066a84ed8d.tar.gz
coinos-server-f87b082c14869c4934b4e5fc7ff4b8066a84ed8d.zip
pass bytes for app secret
-rwxr-xr-xbun.lockbbin233820 -> 234172 bytes
-rw-r--r--lib/db.ts2
-rw-r--r--routes/users.ts3
3 files changed, 3 insertions, 2 deletions
diff --git a/bun.lockb b/bun.lockb
index 4f008120..5fb5f0ad 100755
--- a/bun.lockb
+++ b/bun.lockb
Binary files differ
diff --git a/lib/db.ts b/lib/db.ts
index 12e89757..4e746fa2 100644
--- a/lib/db.ts
+++ b/lib/db.ts
@@ -100,7 +100,7 @@ async function dbReconnect() {
async function archiveReconnect() {
try {
- await archive.connect();
+ if (!archive.isOpen) await archive.connect();
} catch (err) {
console.error("Failed to connect to Redis, retrying...", err);
setTimeout(archiveReconnect, 5000); // Retry after 5 seconds
diff --git a/routes/users.ts b/routes/users.ts
index 9820f504..f4076b77 100644
--- a/routes/users.ts
+++ b/routes/users.ts
@@ -16,6 +16,7 @@ import { $ } from "bun";
import got from "got";
import jwt from "jsonwebtoken";
import { getPublicKey, nip19, verifyEvent } from "nostr-tools";
+import { hexToBytes } from "@noble/hashes/utils";
import { authenticator } from "otplib";
import { v4 } from "uuid";
@@ -996,7 +997,7 @@ export default {
let app = await g(pubkey);
if (app && uid !== app.uid) fail("Unauthorized");
- if (secret) pubkey = getPublicKey(secret);
+ if (secret) pubkey = getPublicKey(hexToBytes(secret));
notify = String(notify) === "true";
app = {