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
|
# Current
|
||||||
|
|
||||||
- [ ] Fix issues
|
- [ ] 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 NIP to support proxies. Update COUNT NIP to mention how proxies are a good use case for COUNT
|
||||||
- [ ] Write blog post on multiplexer
|
- [ ] Write blog post on multiplexer
|
||||||
- [ ] Fix performance issues
|
- [ ] Fix performance issues
|
||||||
@ -21,6 +19,7 @@
|
|||||||
|
|
||||||
# More
|
# More
|
||||||
|
|
||||||
|
- [ ] Nostr Wallet Connect https://nwc.getalby.com/
|
||||||
- [ ] Build per-relay pagination, put it in paravel https://github.com/nostr-protocol/nips/pull/408
|
- [ ] Build per-relay pagination, put it in paravel https://github.com/nostr-protocol/nips/pull/408
|
||||||
- [ ] Linkify topics
|
- [ ] Linkify topics
|
||||||
- [ ] Add suggestion list for topics on compose so people know there are suggestions
|
- [ ] 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",
|
"lru-cache": "^7.18.3",
|
||||||
"nostr-tools": "^1.7.4",
|
"nostr-tools": "^1.7.4",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"paravel": "^0.1.11",
|
"paravel": "^0.1.13",
|
||||||
"qr-scanner": "^1.4.2",
|
"qr-scanner": "^1.4.2",
|
||||||
"qrcode": "^1.5.1",
|
"qrcode": "^1.5.1",
|
||||||
"ramda": "^0.28.0",
|
"ramda": "^0.28.0",
|
||||||
|
@ -90,7 +90,9 @@
|
|||||||
if (!seenChallenges.has(challenge)) {
|
if (!seenChallenges.has(challenge)) {
|
||||||
seenChallenges.add(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() {
|
getSignedEvent() {
|
||||||
return keys.sign(this.event)
|
return keys.sign(this.event)
|
||||||
}
|
}
|
||||||
async publish(relays, onProgress = null) {
|
async publish(relays, onProgress = null, verb = "EVENT") {
|
||||||
const event = await this.getSignedEvent()
|
const event = await this.getSignedEvent()
|
||||||
//console.log(event); return
|
//console.log(event); return
|
||||||
const promise = pool.publish({relays, event, onProgress})
|
const promise = pool.publish({relays, event, onProgress, verb})
|
||||||
|
|
||||||
sync.processEvents(event)
|
sync.processEvents(event)
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ function getExecutor(urls) {
|
|||||||
return executor
|
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 urls = getUrls(relays)
|
||||||
const executor = getExecutor(urls)
|
const executor = getExecutor(urls)
|
||||||
|
|
||||||
@ -235,6 +235,7 @@ async function publish({relays, event, onProgress, timeout = 3000}) {
|
|||||||
}, timeout)
|
}, timeout)
|
||||||
|
|
||||||
const sub = executor.publish(event, {
|
const sub = executor.publish(event, {
|
||||||
|
verb,
|
||||||
onOk: url => {
|
onOk: url => {
|
||||||
succeeded.add(url)
|
succeeded.add(url)
|
||||||
timeouts.delete(url)
|
timeouts.delete(url)
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import cx from "classnames"
|
import cx from "classnames"
|
||||||
import {ellipsize} from "hurdak/lib/hurdak"
|
import {ellipsize} from "hurdak/lib/hurdak"
|
||||||
import {fly, slide} from "svelte/transition"
|
|
||||||
import Anchor from "src/partials/Anchor.svelte"
|
import Anchor from "src/partials/Anchor.svelte"
|
||||||
import Spinner from "src/partials/Spinner.svelte"
|
import Spinner from "src/partials/Spinner.svelte"
|
||||||
import user from "src/agent/user"
|
import user from "src/agent/user"
|
||||||
|
@ -165,8 +165,8 @@ export const parseContent = content => {
|
|||||||
if (urlMatch && !last(result)?.value.endsWith("/")) {
|
if (urlMatch && !last(result)?.value.endsWith("/")) {
|
||||||
let url = urlMatch[0]
|
let url = urlMatch[0]
|
||||||
|
|
||||||
// Skip ellipses
|
// Skip ellipses and very short non-urls
|
||||||
if (!url.match(/\.\./)) {
|
if (!url.match(/\.\./) && url.length > 4) {
|
||||||
// It's common for punctuation to end a url, trim it off
|
// It's common for punctuation to end a url, trim it off
|
||||||
if (url.match(/[\.\?,:]$/)) {
|
if (url.match(/[\.\?,:]$/)) {
|
||||||
url = url.slice(0, -1)
|
url = url.slice(0, -1)
|
||||||
|
Loading…
Reference in New Issue
Block a user