Remove access token logic. (#3187)

Looks like we had some leftover logic from pro. We removed it from
workers, but not (completely) from the client.

### Change Type

<!--  Please select a 'Scope' label ️ -->

- [ ] `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

<!--  Please select a 'Type' label ️ -->

- [ ] `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.
This commit is contained in:
Mitja Bezenšek 2024-03-18 15:34:38 +01:00 committed by GitHub
parent b9b5bd5b81
commit cef70d6a81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 7 deletions

View file

@ -30,7 +30,7 @@ export function useRemoteSyncClient(opts: UseSyncClientConfig): RemoteTLStoreWit
readyClient?: TLSyncClient<TLRecord, TLStore> readyClient?: TLSyncClient<TLRecord, TLStore>
error?: Error error?: Error
} | null>(null) } | null>(null)
const { uri, roomId = 'default', userPreferences: prefs, getAccessToken } = opts const { uri, roomId = 'default', userPreferences: prefs } = opts
const store = useTLStore({ schema }) const store = useTLStore({ schema })
@ -52,10 +52,6 @@ export function useRemoteSyncClient(opts: UseSyncClientConfig): RemoteTLStoreWit
const withParams = new URL(uri) const withParams = new URL(uri)
withParams.searchParams.set('sessionKey', TAB_ID) withParams.searchParams.set('sessionKey', TAB_ID)
withParams.searchParams.set('storeId', store.id) withParams.searchParams.set('storeId', store.id)
const accessToken = await getAccessToken?.()
if (accessToken) {
withParams.searchParams.set('accessToken', accessToken)
}
return withParams.toString() return withParams.toString()
}) })
@ -95,7 +91,7 @@ export function useRemoteSyncClient(opts: UseSyncClientConfig): RemoteTLStoreWit
client.close() client.close()
socket.close() socket.close()
} }
}, [getAccessToken, prefs, roomId, store, uri]) }, [prefs, roomId, store, uri])
return useValue<RemoteTLStoreWithStatus>( return useValue<RemoteTLStoreWithStatus>(
'remote synced store', 'remote synced store',

View file

@ -15,5 +15,4 @@ export type UseSyncClientConfig = {
roomId?: string roomId?: string
userPreferences?: Signal<TLUserPreferences> userPreferences?: Signal<TLUserPreferences>
snapshotForNewRoomRef?: { current: null | TLStoreSnapshot } snapshotForNewRoomRef?: { current: null | TLStoreSnapshot }
getAccessToken?: () => Promise<string | undefined | null> | string | undefined | null
} }