Send BIM viewer requests with credentials

This commit is contained in:
DCCONSTRUCTIONS 2026-06-18 21:43:04 +03:00
parent 3806848b07
commit 477626c597
1 changed files with 3 additions and 1 deletions

View File

@ -302,7 +302,7 @@ export const fetchBeamConversionStatus = async (beamViewer: TBeamViewerAttachmen
const statusUrl = new URL("/api/conversions/status", `${getBeamApiBaseUrl()}/`);
statusUrl.searchParams.set("src", toBeamRelativeUploadSrc(beamViewer.src));
const response = await fetch(statusUrl.toString());
const response = await fetch(statusUrl.toString(), { credentials: "include" });
if (!response.ok) {
throw new Error(`BIM conversion status failed: HTTP ${response.status}`);
}
@ -347,6 +347,7 @@ export const uploadBeamModelFile = (
const xhr = new XMLHttpRequest();
xhr.open("POST", uploadUrl.toString());
xhr.withCredentials = true;
xhr.setRequestHeader("Content-Type", "application/octet-stream");
xhr.upload.addEventListener("progress", (event) => {
if (!event.lengthComputable || !options.onUploadProgress) return;
@ -443,6 +444,7 @@ const deleteBeamStorageResource = async (
): Promise<void> => {
const response = await fetch(new URL(endpoint, `${getBeamApiBaseUrl()}/`).toString(), {
method: "DELETE",
credentials: "include",
headers: {
"Content-Type": "application/json",
},