Skip to content

Commit

Permalink
fix: wrong token being passed in the read-only editor (#5954)
Browse files Browse the repository at this point in the history
* fix: wrong token

* chore: update useMemo dependencies
  • Loading branch information
aaryan610 authored Nov 5, 2024
1 parent ea8583b commit bb311b7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const useReadOnlyCollaborativeEditor = (props: TReadOnlyCollaborativeEdit
new HocuspocusProvider({
url: realtimeConfig.url,
name: id,
token: user.id,
token: JSON.stringify(user),
parameters: realtimeConfig.queryParams,
onAuthenticationFailed: () => {
serverHandler?.onServerError?.();
Expand All @@ -47,7 +47,7 @@ export const useReadOnlyCollaborativeEditor = (props: TReadOnlyCollaborativeEdit
},
onSynced: () => setHasServerSynced(true),
}),
[id, realtimeConfig, user.id]
[id, realtimeConfig, user]
);
// destroy and disconnect connection on unmount
useEffect(
Expand Down

0 comments on commit bb311b7

Please sign in to comment.