mirror of
https://github.com/vitorpamplona/Nostryfied.git
synced 2025-06-06 01:12:04 +00:00
Fixes auth
This commit is contained in:
parent
96dfbc33b0
commit
967d29ef2f
@ -19,7 +19,6 @@ const fetchAndBroadcast = async () => {
|
|||||||
$('#checking-relays-header').text("Waiting for Relays: ")
|
$('#checking-relays-header').text("Waiting for Relays: ")
|
||||||
// parse pubkey ('npub' or hexa)
|
// parse pubkey ('npub' or hexa)
|
||||||
const relaySet = parseRelaySet($('#relaySet').val())
|
const relaySet = parseRelaySet($('#relaySet').val())
|
||||||
console.log(relaySet, $('#relaySet').val())
|
|
||||||
const pubkey = parsePubkey($('#pubkey').val())
|
const pubkey = parsePubkey($('#pubkey').val())
|
||||||
if (!pubkey) return
|
if (!pubkey) return
|
||||||
// disable button (will be re-enable at the end of the process)
|
// disable button (will be re-enable at the end of the process)
|
||||||
|
@ -207,6 +207,7 @@ const fetchFromRelay = async (relay, filters, pubkey, events, relayStatus) =>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (msgType === 'AUTH') {
|
if (msgType === 'AUTH') {
|
||||||
|
console.log(relay, subscriptionId)
|
||||||
signNostrAuthEvent(relay, subscriptionId).then(
|
signNostrAuthEvent(relay, subscriptionId).then(
|
||||||
(event) => {
|
(event) => {
|
||||||
if (event)
|
if (event)
|
||||||
@ -257,7 +258,7 @@ const getEvents = async (filters, pubkey, relaySet) => {
|
|||||||
|
|
||||||
let myRelaySet = null
|
let myRelaySet = null
|
||||||
|
|
||||||
if (relaySet.length > 0)
|
if (relaySet && relaySet.length > 0)
|
||||||
myRelaySet = relaySet
|
myRelaySet = relaySet
|
||||||
else
|
else
|
||||||
myRelaySet = relays
|
myRelaySet = relays
|
||||||
@ -428,7 +429,7 @@ async function signNostrAuthEvent(relay, auth_challenge) {
|
|||||||
kind: 22243, // NIP-42++
|
kind: 22243, // NIP-42++
|
||||||
content: "",
|
content: "",
|
||||||
tags: [
|
tags: [
|
||||||
["relay", relay]
|
["relay", relay],
|
||||||
["challenge", auth_challenge]
|
["challenge", auth_challenge]
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user