Fixes auth

This commit is contained in:
Vitor Pamplona 2024-01-28 14:01:42 -05:00
parent 96dfbc33b0
commit 967d29ef2f
2 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,6 @@ const fetchAndBroadcast = async () => {
$('#checking-relays-header').text("Waiting for Relays: ")
// parse pubkey ('npub' or hexa)
const relaySet = parseRelaySet($('#relaySet').val())
console.log(relaySet, $('#relaySet').val())
const pubkey = parsePubkey($('#pubkey').val())
if (!pubkey) return
// disable button (will be re-enable at the end of the process)

View File

@ -207,6 +207,7 @@ const fetchFromRelay = async (relay, filters, pubkey, events, relayStatus) =>
}
if (msgType === 'AUTH') {
console.log(relay, subscriptionId)
signNostrAuthEvent(relay, subscriptionId).then(
(event) => {
if (event)
@ -257,7 +258,7 @@ const getEvents = async (filters, pubkey, relaySet) => {
let myRelaySet = null
if (relaySet.length > 0)
if (relaySet && relaySet.length > 0)
myRelaySet = relaySet
else
myRelaySet = relays
@ -428,7 +429,7 @@ async function signNostrAuthEvent(relay, auth_challenge) {
kind: 22243, // NIP-42++
content: "",
tags: [
["relay", relay]
["relay", relay],
["challenge", auth_challenge]
],
};