[WEB-2729] chore: updated live server auth cookies handling (#5913)
* chore: updated live server auth cookies handling * chore: update token parsing logic * fix: types and better logical seperation between the existing two tokens * fix: better fallback to use request headers for cookies --------- Co-authored-by: Palanikannan M <akashmalinimurugu@gmail.com>
This commit is contained in:
parent
403482fa6e
commit
8ea34b5995
6 changed files with 54 additions and 33 deletions
|
|
@ -39,7 +39,7 @@ export const useCollaborativeEditor = (props: TCollaborativeEditorProps) => {
|
|||
name: id,
|
||||
parameters: realtimeConfig.queryParams,
|
||||
// using user id as a token to verify the user on the server
|
||||
token: user.id,
|
||||
token: JSON.stringify(user),
|
||||
url: realtimeConfig.url,
|
||||
onAuthenticationFailed: () => {
|
||||
serverHandler?.onServerError?.();
|
||||
|
|
|
|||
|
|
@ -138,6 +138,7 @@ export type TUserDetails = {
|
|||
color: string;
|
||||
id: string;
|
||||
name: string;
|
||||
cookie?: string;
|
||||
};
|
||||
|
||||
export type TRealtimeConfig = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue