fix: resolve file management operations not working (#83)

- Fix rename: context menu was nullifying target reference before rename dialog could use it
- Fix delete files/folders: auth extractors were mandatory, causing 401 when auth not configured
- Fix view-file: async fetch race condition with context menu cleanup
- Fix orphaned ID mappings on file deletion
- Fix Authorization: Bearer null headers sent without token
- Add OptionalUserId and OptionalAuthUser infallible extractors
This commit is contained in:
Dionisio
2026-02-13 08:54:51 +01:00
parent 915d9a4353
commit fb65d1976b
9 changed files with 294 additions and 63 deletions
+11 -8
View File
@@ -680,12 +680,15 @@ async function loadFiles(options = {}) {
}
const token = localStorage.getItem('oxicloud_token');
const headers = {
'Cache-Control': 'no-cache, no-store, must-revalidate',
'Pragma': 'no-cache'
};
if (token) {
headers['Authorization'] = `Bearer ${token}`;
}
const requestOptions = {
headers: {
'Authorization': `Bearer ${token}`,
'Cache-Control': 'no-cache, no-store, must-revalidate',
'Pragma': 'no-cache'
},
headers,
cache: 'no-store' // Instruct the browser not to use cache
};
@@ -1727,10 +1730,10 @@ async function findUserHomeFolder(username) {
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), 3000); // Reduced timeout to 3 seconds
const folderToken = localStorage.getItem('oxicloud_token');
const folderHeaders = folderToken ? { 'Authorization': `Bearer ${folderToken}` } : {};
const response = await fetch('/api/folders', {
headers: {
'Authorization': `Bearer ${localStorage.getItem('oxicloud_token')}`
},
headers: folderHeaders,
signal: controller.signal
});