From f7548265e58c78c3c1661ec6b1100ca8c08023f1 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 31 Mar 2026 12:12:39 +0100 Subject: [PATCH] fix: key atproto client by host --- server/utils/atproto.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/utils/atproto.ts b/server/utils/atproto.ts index 893cab2..05ed936 100644 --- a/server/utils/atproto.ts +++ b/server/utils/atproto.ts @@ -58,9 +58,11 @@ function kvStateStore(): NodeSavedStateStore { const _locks = new Map>() let _client: NodeOAuthClient | null = null +let _clientHost: string | null = null export function getAtprotoClient(event: H3Event): NodeOAuthClient { - if (_client) return _client + const host = getRequestURL(event).host + if (_client && _clientHost === host) return _client _client = new NodeOAuthClient({ clientMetadata: getAtprotoClientMetadata(event, 'bluesky'), sessionStore: kvSessionStore(), @@ -72,6 +74,7 @@ export function getAtprotoClient(event: H3Event): NodeOAuthClient { return promise }, }) + _clientHost = host return _client } -- knotmirror 0.0.1