Enable auth for relays we're publishing to
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user