Compare commits

..

No commits in common. "a8fd9eb96bd7cb29d4db2d248e55f86b618f4ac7" and "7ce36dfb372cdc76e5bba1409d7bd7f588408752" have entirely different histories.

2 changed files with 2 additions and 2 deletions

View file

@ -1,7 +1,7 @@
import { main } from "./src/main.ts"; import { main } from "./src/main.ts";
let relay = process.env.RELAY_URL ?? Bun.argv[Bun.argv.length - 1]; let relay = process.env.RELAY_URL ?? Bun.argv[Bun.argv.length - 1];
if (!relay?.startsWith("wss://") && !relay?.startsWith("ws://")) if (!relay?.startsWith("wss://"))
relay = "wss://relay.arx-ccn.com"; relay = "wss://relay.arx-ccn.com";
main(relay) main(relay)

View file

@ -23,7 +23,7 @@ async function validateAuthEvent(event: Event, challenge: string): boolean {
const challengeTag = event.tags.find(tag => tag[0] === 'challange')?.[1]; const challengeTag = event.tags.find(tag => tag[0] === 'challange')?.[1];
if (challengeTag !== challenge) return false; if (challengeTag !== challenge) return false;
const file = Bun.file("./allowed-pubkeys.json"); const file = Bun.file("./allowed-pubkeys.json");
if (!await file.exists()) return true; if (!file.exists()) return true;
const allowedPubkeys = JSON.parse(await file.text()); const allowedPubkeys = JSON.parse(await file.text());
if (!allowedPubkeys.includes(event.pubkey)) return false; if (!allowedPubkeys.includes(event.pubkey)) return false;
return true; return true;