From 1b243770522a7195a75cd5173194ef4513c5b2fc Mon Sep 17 00:00:00 2001 From: Jonathan Staab Date: Mon, 3 Apr 2023 10:12:03 -0500 Subject: [PATCH] Fix AUTH --- ROADMAP.md | 3 +-- package-lock.json | Bin 603917 -> 603917 bytes package.json | 2 +- src/App.svelte | 4 +++- src/agent/cmd.ts | 4 ++-- src/agent/pool.ts | 3 ++- src/partials/CarouselItem.svelte | 1 - src/util/html.ts | 4 ++-- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index bd1cb366..a769c99d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,8 +1,6 @@ # Current - [ ] Fix issues -- [ ] Don't escape html in parseContent -- [ ] Look into AUTH not working for mazin - [ ] Write NIP to support proxies. Update COUNT NIP to mention how proxies are a good use case for COUNT - [ ] Write blog post on multiplexer - [ ] Fix performance issues @@ -21,6 +19,7 @@ # More +- [ ] Nostr Wallet Connect https://nwc.getalby.com/ - [ ] Build per-relay pagination, put it in paravel https://github.com/nostr-protocol/nips/pull/408 - [ ] Linkify topics - [ ] Add suggestion list for topics on compose so people know there are suggestions diff --git a/package-lock.json b/package-lock.json index 195b630813d814840aa7cec55818f4d23a5c1be3..06491e1a44b038a44b0aa86f83b8077f9ec0a10b 100644 GIT binary patch delta 281 zcmeBur_%dQWy4=4M&ssxOzr=e7=f5+`#&aTyH(STcQYDI&s)nZK3(|*qjIQEu3x!l zP`a5%Ubu&$p}V1}e_CExiN14oxw&OTNM>engqOZ~v3^jIo3T%Zx0|yH delta 279 zcmeBur_%dQWy4=4M#JWROzr=e7=f5+`#&aTyH(SlPGmEhp0}1+eDdM*%AoYoF77a#z@gj@bjS7!BAm8L0HcUw$N&HU diff --git a/package.json b/package.json index b8cd7198..3e266123 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "lru-cache": "^7.18.3", "nostr-tools": "^1.7.4", "npm-run-all": "^4.1.5", - "paravel": "^0.1.11", + "paravel": "^0.1.13", "qr-scanner": "^1.4.2", "qrcode": "^1.5.1", "ramda": "^0.28.0", diff --git a/src/App.svelte b/src/App.svelte index 70001e9c..734555c5 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -90,7 +90,9 @@ if (!seenChallenges.has(challenge)) { seenChallenges.add(challenge) - return first(await cmd.authenticate(url, challenge).publish([{url}])) + const publishable = await cmd.authenticate(url, challenge) + + return first(publishable.publish([{url}], null, "AUTH")) } } diff --git a/src/agent/cmd.ts b/src/agent/cmd.ts index 20839aca..5f81a8d3 100644 --- a/src/agent/cmd.ts +++ b/src/agent/cmd.ts @@ -178,10 +178,10 @@ class PublishableEvent { getSignedEvent() { return keys.sign(this.event) } - async publish(relays, onProgress = null) { + async publish(relays, onProgress = null, verb = "EVENT") { const event = await this.getSignedEvent() //console.log(event); return - const promise = pool.publish({relays, event, onProgress}) + const promise = pool.publish({relays, event, onProgress, verb}) sync.processEvents(event) diff --git a/src/agent/pool.ts b/src/agent/pool.ts index 1048768c..b915274f 100644 --- a/src/agent/pool.ts +++ b/src/agent/pool.ts @@ -191,7 +191,7 @@ function getExecutor(urls) { return executor } -async function publish({relays, event, onProgress, timeout = 3000}) { +async function publish({relays, event, onProgress, timeout = 3000, verb = "EVENT"}) { const urls = getUrls(relays) const executor = getExecutor(urls) @@ -235,6 +235,7 @@ async function publish({relays, event, onProgress, timeout = 3000}) { }, timeout) const sub = executor.publish(event, { + verb, onOk: url => { succeeded.add(url) timeouts.delete(url) diff --git a/src/partials/CarouselItem.svelte b/src/partials/CarouselItem.svelte index 95fbd4a5..8b49b05b 100644 --- a/src/partials/CarouselItem.svelte +++ b/src/partials/CarouselItem.svelte @@ -1,7 +1,6 @@