mirror of
https://github.com/coracle-social/coracle.git
synced 2024-10-06 11:43:30 +00:00
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
|
||||
|
BIN
package-lock.json
generated
BIN
package-lock.json
generated
Binary file not shown.
@ -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
Block a user