From 1d7620a05792b7ad25b5f00438ca62a9c19769d0 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 5 Apr 2024 07:22:17 -0300 Subject: [PATCH] temporary _onauth handler until we figure stuff out. --- abstract-relay.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/abstract-relay.ts b/abstract-relay.ts index 8189993..5bc3c10 100644 --- a/abstract-relay.ts +++ b/abstract-relay.ts @@ -24,6 +24,9 @@ export class AbstractRelay { public onclose: (() => void) | null = null public onnotice: (msg: string) => void = msg => console.debug(`NOTICE from ${this.url}: ${msg}`) + // this is exposed just to help in ndk migration, shouldn't be relied upon + public _onauth: ((challenge: string) => void) | null = null + public baseEoseTimeout: number = 4400 public connectionTimeout: number = 4400 public openSubs: Map = new Map() @@ -215,6 +218,7 @@ export class AbstractRelay { return case 'AUTH': { this.challenge = data[1] as string + this._onauth?.(data[1] as string) return } }