From 0ca731f5423048f1b034b3f615353bc1dda13cab Mon Sep 17 00:00:00 2001 From: austinkelsay Date: Sun, 13 Oct 2024 14:12:20 -0500 Subject: [PATCH] Add read only relays for testing phase except for plebdevs relay --- src/context/NDKContext.js | 6 +++++- src/pages/api/auth/[...nextauth].js | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/context/NDKContext.js b/src/context/NDKContext.js index 6daad8e..7a87965 100644 --- a/src/context/NDKContext.js +++ b/src/context/NDKContext.js @@ -6,9 +6,13 @@ import appConfig from "@/config/appConfig"; const NDKContext = createContext(null); +const readOnlyRelays = ["wss://nostr21.com/", "wss://nostr.wine/", "wss://yestr.me/", "wss://lightningrelay.com/", "wss://nostr.land/", "wss://us.nsotr.land", "wss://relay.keychat.io"]; + export const NDKProvider = ({ children }) => { const [ndk, setNdk] = useState(null); - const [userRelays, setUserRelays] = useLocalStorage("userRelays", appConfig.defaultRelayUrls); + // todo: remove this after testing phase + // const [userRelays, setUserRelays] = useLocalStorage("userRelays", appConfig.defaultRelayUrls); + const [userRelays, setUserRelays] = useState(readOnlyRelays); const createNDKInstance = (relays) => { const allRelays = [...new Set([...appConfig.defaultRelayUrls, ...relays])]; diff --git a/src/pages/api/auth/[...nextauth].js b/src/pages/api/auth/[...nextauth].js index d6f9669..7a7dcd9 100644 --- a/src/pages/api/auth/[...nextauth].js +++ b/src/pages/api/auth/[...nextauth].js @@ -13,9 +13,8 @@ import { createRole } from "@/db/models/roleModels"; import appConfig from "@/config/appConfig"; // todo update EMAIL_FROM to be a plebdevs email -// TODO: remove hardcoded relays from here after testing phase const ndk = new NDK({ - explicitRelayUrls: [...appConfig.defaultRelayUrls, "wss://relay.damus.io/", "wss://relay.snort.social/"], + explicitRelayUrls: appConfig.defaultRelayUrls }); const authorize = async (pubkey) => {