From 3297f9d501421d9445c4c8785e365a99e05b2a5a Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Sun, 28 Jan 2024 14:10:55 -0500 Subject: [PATCH] Testing auth --- index.html | 2 +- js/nostr-utils.js | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 6574bcc..c667dae 100644 --- a/index.html +++ b/index.html @@ -62,7 +62,7 @@ type="text" id="relaySet" name="relaySet" - placeholder="wss://nos.lol" + placeholder="Force relays or blank to use your list: wss://nos.lol" style="width: 180px" value="" />

diff --git a/js/nostr-utils.js b/js/nostr-utils.js index 8c9fc13..c2b51c8 100644 --- a/js/nostr-utils.js +++ b/js/nostr-utils.js @@ -420,13 +420,8 @@ function sha256Hex(string) { async function signNostrAuthEvent(relay, auth_challenge) { try { - - if (!window.nostr) { - throw "Nostr extension not loaded or available" - } - let msg = { - kind: 22243, // NIP-42++ + kind: 22243, content: "", tags: [ ["relay", relay], @@ -434,6 +429,8 @@ async function signNostrAuthEvent(relay, auth_challenge) { ], }; + console.log(msg) + // set msg fields msg.created_at = Math.floor((new Date()).getTime() / 1000); msg.pubkey = await window.nostr.getPublicKey();