fix: wrong token being passed in the read-only editor (#5954)
* fix: wrong token * chore: update useMemo dependencies
This commit is contained in:
parent
ea8583b2d4
commit
bb311b750f
1 changed files with 2 additions and 2 deletions
|
|
@ -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?.();
|
||||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue