Enable auth for relays we're publishing to
This commit is contained in:
parent
c43544734a
commit
f5c768d6a7
1 changed files with 2 additions and 1 deletions
|
|
@ -15,7 +15,7 @@ import {
|
||||||
isClientNegOpen,
|
isClientNegOpen,
|
||||||
isClientNegClose,
|
isClientNegClose,
|
||||||
} from "@welshman/net"
|
} from "@welshman/net"
|
||||||
import {sign, pubkey, getPubkeyRelays} from "@welshman/app"
|
import {sign, pubkey, thunks, getPubkeyRelays} from "@welshman/app"
|
||||||
import {
|
import {
|
||||||
BLOCKED_RELAYS,
|
BLOCKED_RELAYS,
|
||||||
userSettingsValues,
|
userSettingsValues,
|
||||||
|
|
@ -36,6 +36,7 @@ export const authPolicy = makeSocketPolicyAuth({
|
||||||
if (mode === RelayAuthMode.Aggressive) return true
|
if (mode === RelayAuthMode.Aggressive) return true
|
||||||
if (get(userSpaceUrls).includes(socket.url)) return true
|
if (get(userSpaceUrls).includes(socket.url)) return true
|
||||||
if (getPubkeyRelays($pubkey).includes(socket.url)) return true
|
if (getPubkeyRelays($pubkey).includes(socket.url)) return true
|
||||||
|
if (get(thunks).some(t => t.options.relays.includes(socket.url))) return true
|
||||||
if (getPubkeyRelays($pubkey, RelayMode.Messaging).includes(socket.url)) return true
|
if (getPubkeyRelays($pubkey, RelayMode.Messaging).includes(socket.url)) return true
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue