fix: remove auth token from /api/command

This commit is contained in:
Henrique Dias 2025-06-26 15:01:46 +02:00
parent e2e1e49130
commit d5b39a14fd
No known key found for this signature in database

View File

@ -1,6 +1,6 @@
import { removePrefix } from "./utils";
import { baseURL } from "@/utils/constants";
import { useAuthStore } from "@/stores/auth";
import { baseURL } from "@/utils/constants";
import { removePrefix } from "./utils";
const ssl = window.location.protocol === "https:";
const protocol = ssl ? "wss:" : "ws:";
@ -14,7 +14,7 @@ export default function command(
const authStore = useAuthStore();
url = removePrefix(url);
url = `${protocol}//${window.location.host}${baseURL}/api/command${url}?auth=${authStore.jwt}`;
url = `${protocol}//${window.location.host}${baseURL}/api/command${url}`;
const conn = new window.WebSocket(url);
conn.onopen = () => conn.send(command);