Fix AUTH
This commit is contained in:
parent
9bc5a35957
commit
1b24377052
|
@ -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
|
||||
|
|
|
@ -23,7 +23,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",
|
||||
|
@ -6183,9 +6183,9 @@
|
|||
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
|
||||
},
|
||||
"node_modules/paravel": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/paravel/-/paravel-0.1.11.tgz",
|
||||
"integrity": "sha512-PCnI0/7vGfrGnYmN4DAZk4bJQlfjAxCe0HNSd+UoGD+/qIvlhbH6XoKhG2wJ8x8FMdNIF97MM66aq/LYVuJoZQ==",
|
||||
"version": "0.1.13",
|
||||
"resolved": "https://registry.npmjs.org/paravel/-/paravel-0.1.13.tgz",
|
||||
"integrity": "sha512-LmNwIRg6HnWH11G15OfnVt/Ckw79XTiisXJ/7s/RrF3LhKFK6XpNTi6i2gMo6WlAgJp39WzW4/zDF6sKzFcZDA==",
|
||||
"dependencies": {
|
||||
"husky": "^8.0.3",
|
||||
"isomorphic-ws": "^5.0.0",
|
||||
|
@ -13021,9 +13021,9 @@
|
|||
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
|
||||
},
|
||||
"paravel": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/paravel/-/paravel-0.1.11.tgz",
|
||||
"integrity": "sha512-PCnI0/7vGfrGnYmN4DAZk4bJQlfjAxCe0HNSd+UoGD+/qIvlhbH6XoKhG2wJ8x8FMdNIF97MM66aq/LYVuJoZQ==",
|
||||
"version": "0.1.13",
|
||||
"resolved": "https://registry.npmjs.org/paravel/-/paravel-0.1.13.tgz",
|
||||
"integrity": "sha512-LmNwIRg6HnWH11G15OfnVt/Ckw79XTiisXJ/7s/RrF3LhKFK6XpNTi6i2gMo6WlAgJp39WzW4/zDF6sKzFcZDA==",
|
||||
"requires": {
|
||||
"husky": "^8.0.3",
|
||||
"isomorphic-ws": "^5.0.0",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<script>
|
||||
import cx from "classnames"
|
||||
import {ellipsize} from "hurdak/lib/hurdak"
|
||||
import {fly, slide} from "svelte/transition"
|
||||
import Anchor from "src/partials/Anchor.svelte"
|
||||
import Spinner from "src/partials/Spinner.svelte"
|
||||
import user from "src/agent/user"
|
||||
|
|
|
@ -165,8 +165,8 @@ export const parseContent = content => {
|
|||
if (urlMatch && !last(result)?.value.endsWith("/")) {
|
||||
let url = urlMatch[0]
|
||||
|
||||
// Skip ellipses
|
||||
if (!url.match(/\.\./)) {
|
||||
// Skip ellipses and very short non-urls
|
||||
if (!url.match(/\.\./) && url.length > 4) {
|
||||
// It's common for punctuation to end a url, trim it off
|
||||
if (url.match(/[\.\?,:]$/)) {
|
||||
url = url.slice(0, -1)
|
||||
|
|
Loading…
Reference in New Issue