Fix bugs: office auth, PDF worker, sidebar pins, direct downloads
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m0s

This commit is contained in:
Elijah 2026-05-31 21:16:17 -07:00
parent e88243f097
commit bfe55e2bfc
6 changed files with 74 additions and 32 deletions

View file

@ -80,6 +80,7 @@ class ApiClient {
if (!retryResponse.ok && retryResponse.status === 401) {
if (typeof window !== 'undefined') window.dispatchEvent(new Event('auth_error'));
this.clearTokens();
throw new Error(`HTTP 401`);
}
@ -90,6 +91,7 @@ class ApiClient {
if (!response.ok && endpoint !== '/api/auth/refresh') {
if (response.status === 401) {
if (typeof window !== 'undefined') window.dispatchEvent(new Event('auth_error'));
this.clearTokens();
}
let errorMsg = `HTTP ${response.status}`;
try {
@ -318,8 +320,9 @@ class ApiClient {
return data.token;
}
getDownloadUrl(path: string, token: string) {
return `${API_BASE}/api/files/download?path=${encodeURIComponent(path)}&token=${token}`;
getDownloadUrl(path: string, token: string, forceDownload: boolean = false) {
const url = `${API_BASE}/api/files/download?path=${encodeURIComponent(path)}&token=${token}`;
return forceDownload ? `${url}&download=true` : url;
}
getDownloadFolderUrl(path: string, token: string) {