aboutsummaryrefslogtreecommitdiffstats
path: root/routes/nostr.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-02-11 13:40:05 -0800
committerAdam Soltys <[email protected]>2025-02-11 13:40:05 -0800
commitde7435e34580e1a9b4b8d95b2a5013112414098f (patch)
tree97074cadf3a63512c2c5f554a3083924fd046b74 /routes/nostr.ts
parent8add46c0975686ce0967c2c38514a31aad6ee8cb (diff)
downloadcoinos-server-de7435e34580e1a9b4b8d95b2a5013112414098f.tar.gz
coinos-server-de7435e34580e1a9b4b8d95b2a5013112414098f.zip
default app on register
Diffstat (limited to 'routes/nostr.ts')
-rw-r--r--routes/nostr.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/routes/nostr.ts b/routes/nostr.ts
index 5000ccc7..9c61bf16 100644
--- a/routes/nostr.ts
+++ b/routes/nostr.ts
@@ -8,6 +8,7 @@ import {
getNostrUser,
getProfile,
pool,
+ publish,
q,
serverPubkey,
} from "$lib/nostr";
@@ -16,7 +17,6 @@ import { scan } from "$lib/strfry";
import { bail, fail, fields, getUser } from "$lib/utils";
import got from "got";
import type { Event } from "nostr-tools";
-import { verifyEvent } from "nostr-tools";
import { decode } from "nostr-tools/nip19";
import type { ProfilePointer } from "nostr-tools/nip19";
import { getZapEndpoint, makeZapRequest } from "nostr-tools/nip57";
@@ -207,10 +207,8 @@ export default {
try {
const { event } = req.body;
const { pubkey } = req.user;
- // const { write: relays } = await getRelays(pubkey);
- // if (!relays.includes(config.nostr)) relays.push(config.nostr);
- if (!verifyEvent(event)) fail("Invalid event");
- await load(JSON.stringify(event));
+
+ await publish(event);
if (event.kind === 3) {
db.del(`${pubkey}:follows`);
@@ -219,6 +217,7 @@ export default {
res.send({});
} catch (e) {
+ console.log(e);
bail(res, e.message);
}
},