mirror of
https://github.com/vitorpamplona/Nostryfied.git
synced 2025-06-06 01:12:04 +00:00
more auth
This commit is contained in:
parent
f753cfb40f
commit
4a01bfbc7f
@ -210,9 +210,10 @@ const fetchFromRelay = async (relay, filters, pubkey, events, relayStatus) =>
|
|||||||
console.log(relay, subscriptionId)
|
console.log(relay, subscriptionId)
|
||||||
signNostrAuthEvent(relay, subscriptionId).then(
|
signNostrAuthEvent(relay, subscriptionId).then(
|
||||||
(event) => {
|
(event) => {
|
||||||
if (event)
|
if (event) {
|
||||||
|
console.log("AUTH", JSON.stringify(['EVENT', event]))
|
||||||
ws.send(JSON.stringify(['EVENT', event]))
|
ws.send(JSON.stringify(['EVENT', event]))
|
||||||
else {
|
} else {
|
||||||
updateRelayStatus(relay, "AUTH Req", 0, undefined, relayStatus)
|
updateRelayStatus(relay, "AUTH Req", 0, undefined, relayStatus)
|
||||||
ws.close()
|
ws.close()
|
||||||
reject(relay)
|
reject(relay)
|
||||||
@ -228,6 +229,7 @@ const fetchFromRelay = async (relay, filters, pubkey, events, relayStatus) =>
|
|||||||
|
|
||||||
if (msgType === 'OK') {
|
if (msgType === 'OK') {
|
||||||
// auth ok.
|
// auth ok.
|
||||||
|
console.log("AUTH", JSON.stringify(['EVENT', event]))
|
||||||
for (const [key, sub] of Object.entries(subscriptions)) {
|
for (const [key, sub] of Object.entries(subscriptions)) {
|
||||||
ws.send(JSON.stringify(['REQ', sub.id, sub.filter]))
|
ws.send(JSON.stringify(['REQ', sub.id, sub.filter]))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user