Skip to content
Snippets Groups Projects
Verified Commit d6b5ba70 authored by Dennis Collaris's avatar Dennis Collaris
Browse files

feat: ensure session ids match upon (re) connect

parent cc5ccba0
No related branches found
Tags v1.121.0
1 merge request!470fix: proper random uuids for callID
......@@ -166,6 +166,11 @@ export const EventBus = (props: { onRunQuery: (useCached: boolean) => void; onAu
wsReconnectSubscription(data => {
if (data == null) return;
if (!Broker.instance().checkSessionID(data.sessionID)) {
dispatch(addError('DEBUG: session id does not match!!'));
throw new Error('Session ID does not match!!');
}
dispatch(setSessionID(data));
props.onAuthorized();
......
......@@ -272,4 +272,8 @@ export class Broker {
private onError(event: any): void {
console.error('WS error', event);
}
public checkSessionID(sessionID: string) {
return this.authHeader?.sessionID == sessionID;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment