From cef70d6a819e3d6b0115b9208aa7139babc09f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mitja=20Bezen=C5=A1ek?= Date: Mon, 18 Mar 2024 15:34:38 +0100 Subject: [PATCH] Remove access token logic. (#3187) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Looks like we had some leftover logic from pro. We removed it from workers, but not (completely) from the client. ### Change Type - [ ] `sdk` — Changes the tldraw SDK - [x] `dotcom` — Changes the tldraw.com web app - [ ] `docs` — Changes to the documentation, examples, or templates. - [ ] `vs code` — Changes to the vscode plugin - [ ] `internal` — Does not affect user-facing stuff - [ ] `bugfix` — Bug fix - [ ] `feature` — New feature - [ ] `improvement` — Improving existing features - [x] `chore` — Updating dependencies, other boring stuff - [ ] `galaxy brain` — Architectural changes - [ ] `tests` — Changes to any test code - [ ] `tools` — Changes to infrastructure, CI, internal scripts, debugging tools, etc. - [ ] `dunno` — I don't know ### Release Notes - Remove some leftover logic from pro days. --- apps/dotcom/src/hooks/useRemoteSyncClient.ts | 8 ++------ apps/dotcom/src/utils/remote-sync/remote-sync.ts | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/apps/dotcom/src/hooks/useRemoteSyncClient.ts b/apps/dotcom/src/hooks/useRemoteSyncClient.ts index bdd134d4f..42bd6aab4 100644 --- a/apps/dotcom/src/hooks/useRemoteSyncClient.ts +++ b/apps/dotcom/src/hooks/useRemoteSyncClient.ts @@ -30,7 +30,7 @@ export function useRemoteSyncClient(opts: UseSyncClientConfig): RemoteTLStoreWit readyClient?: TLSyncClient error?: Error } | null>(null) - const { uri, roomId = 'default', userPreferences: prefs, getAccessToken } = opts + const { uri, roomId = 'default', userPreferences: prefs } = opts const store = useTLStore({ schema }) @@ -52,10 +52,6 @@ export function useRemoteSyncClient(opts: UseSyncClientConfig): RemoteTLStoreWit const withParams = new URL(uri) withParams.searchParams.set('sessionKey', TAB_ID) withParams.searchParams.set('storeId', store.id) - const accessToken = await getAccessToken?.() - if (accessToken) { - withParams.searchParams.set('accessToken', accessToken) - } return withParams.toString() }) @@ -95,7 +91,7 @@ export function useRemoteSyncClient(opts: UseSyncClientConfig): RemoteTLStoreWit client.close() socket.close() } - }, [getAccessToken, prefs, roomId, store, uri]) + }, [prefs, roomId, store, uri]) return useValue( 'remote synced store', diff --git a/apps/dotcom/src/utils/remote-sync/remote-sync.ts b/apps/dotcom/src/utils/remote-sync/remote-sync.ts index 715f24173..4d9cdeaed 100644 --- a/apps/dotcom/src/utils/remote-sync/remote-sync.ts +++ b/apps/dotcom/src/utils/remote-sync/remote-sync.ts @@ -15,5 +15,4 @@ export type UseSyncClientConfig = { roomId?: string userPreferences?: Signal snapshotForNewRoomRef?: { current: null | TLStoreSnapshot } - getAccessToken?: () => Promise | string | undefined | null }