mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 21:51:24 +00:00
fix(gateway): harden canvas auth with session capabilities
This commit is contained in:
@@ -120,8 +120,10 @@ export function injectCanvasLiveReload(html: string): string {
|
||||
globalThis.openclawSendUserAction = sendUserAction;
|
||||
|
||||
try {
|
||||
const cap = new URLSearchParams(location.search).get("oc_cap");
|
||||
const proto = location.protocol === "https:" ? "wss" : "ws";
|
||||
const ws = new WebSocket(proto + "://" + location.host + ${JSON.stringify(CANVAS_WS_PATH)});
|
||||
const capQuery = cap ? "?oc_cap=" + encodeURIComponent(cap) : "";
|
||||
const ws = new WebSocket(proto + "://" + location.host + ${JSON.stringify(CANVAS_WS_PATH)} + capQuery);
|
||||
ws.onmessage = (ev) => {
|
||||
if (String(ev.data || "") === "reload") location.reload();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user