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.
pull/3198/head^2
Mitja Bezenšek 2024-03-18 15:34:38 +01:00 zatwierdzone przez GitHub
rodzic b9b5bd5b81
commit cef70d6a81
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
2 zmienionych plików z 2 dodań i 7 usunięć

Wyświetl plik

@ -30,7 +30,7 @@ export function useRemoteSyncClient(opts: UseSyncClientConfig): RemoteTLStoreWit
readyClient?: TLSyncClient<TLRecord, TLStore>
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<RemoteTLStoreWithStatus>(
'remote synced store',

Wyświetl plik

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