Skip to content

Commit d8d364e

Browse files
committed
code: cleanup & fix NIP-42 for upstream
- Fix NIP-42 authentication in bouncer side - Split event handler codes for receiver Signed-off-by: Yonle <[email protected]>
1 parent 4af2f40 commit d8d364e

File tree

2 files changed

+173
-153
lines changed

2 files changed

+173
-153
lines changed

nip42.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
const { threadId } = require("node:worker_threads");
23
const { finalizeEvent, nip19 } = require("nostr-tools");
34

45
module.exports = (relay, pubkey, privkey, challenge) => {
@@ -16,4 +17,6 @@ module.exports = (relay, pubkey, privkey, challenge) => {
1617
}, privkey);
1718

1819
relay.send(JSON.stringify(["AUTH", signed_challenge]));
20+
21+
console.log(threadId, "-", relay.id, "NIP-42: Sending Signed Challenge to", relay.url);
1922
}

0 commit comments

Comments
 (0)