mirror of
https://github.com/Noooste/garage-ui.git
synced 2026-08-12 06:26:56 +00:00
feat: enhance authentication with JWT support and clean up unused code
This commit is contained in:
@@ -100,7 +100,6 @@ export function ObjectBrowserView({
|
||||
return new Promise((resolve) => {
|
||||
if (item.isFile) {
|
||||
item.file((file: File) => {
|
||||
// Add the relative path to the file object
|
||||
const fullPath = path + file.name;
|
||||
Object.defineProperty(file, 'webkitRelativePath', {
|
||||
value: fullPath,
|
||||
|
||||
@@ -16,7 +16,6 @@ import type {
|
||||
StorageMetrics,
|
||||
} from '@/types';
|
||||
|
||||
// Configure axios instance with base URL
|
||||
const api = axios.create({
|
||||
baseURL: import.meta.env.VITE_API_URL || 'http://localhost:8080/api',
|
||||
headers: {
|
||||
@@ -24,7 +23,6 @@ const api = axios.create({
|
||||
},
|
||||
});
|
||||
|
||||
// Add request interceptor for authentication
|
||||
api.interceptors.request.use((config) => {
|
||||
const token = localStorage.getItem('auth-token');
|
||||
if (token) {
|
||||
@@ -33,7 +31,6 @@ api.interceptors.request.use((config) => {
|
||||
return config;
|
||||
});
|
||||
|
||||
// Add response interceptor for error handling
|
||||
api.interceptors.response.use(
|
||||
(response) => {
|
||||
// If response has success=false in data, treat it as an error
|
||||
@@ -119,7 +116,6 @@ export const bucketsApi = {
|
||||
},
|
||||
|
||||
updateSettings: async (name: string, settings: Partial<BucketDetails>): Promise<void> => {
|
||||
// TODO: Implement when backend endpoint is ready
|
||||
await api.patch(`/v1/buckets/${name}/settings`, settings);
|
||||
},
|
||||
};
|
||||
@@ -185,12 +181,6 @@ export const objectsApi = {
|
||||
});
|
||||
},
|
||||
|
||||
uploadStream: async (bucket: string, key: string, data: Blob | File, contentType?: string): Promise<void> => {
|
||||
await api.put(`/v1/buckets/${bucket}/objects/${encodeURIComponent(key)}`, data, {
|
||||
headers: { 'Content-Type': contentType || 'application/octet-stream' },
|
||||
});
|
||||
},
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
uploadMultiple: async (bucket: string, files: File[]): Promise<any> => {
|
||||
const formData = new FormData();
|
||||
|
||||
@@ -199,10 +199,8 @@ export function AccessControl() {
|
||||
try {
|
||||
const updates: { status?: string; expiration?: string } = {};
|
||||
|
||||
// Add status change
|
||||
updates.status = keyStatus;
|
||||
|
||||
// Add expiration if set and not "never expires"
|
||||
if (!neverExpires && expirationDate) {
|
||||
updates.expiration = new Date(expirationDate).toISOString();
|
||||
} else if (neverExpires) {
|
||||
|
||||
Reference in New Issue
Block a user