From 7bb92d3bd9ebce588e73ad53fa0316de2cb6633a Mon Sep 17 00:00:00 2001 From: Daniel Bedeleanu Date: Wed, 22 Apr 2026 18:04:36 +0300 Subject: [PATCH] fix(5): add authorization headers to export API calls --- frontend/hooks/useExport.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/hooks/useExport.ts b/frontend/hooks/useExport.ts index 45102447..b736ab32 100644 --- a/frontend/hooks/useExport.ts +++ b/frontend/hooks/useExport.ts @@ -49,11 +49,13 @@ export function useExport(): UseExportReturn { setError(null); try { + const token = localStorage.getItem('auth_token'); const response = await axios.post( `/api/admin/exports/inventory-snapshot?format=${format}`, {}, { responseType: "blob", + headers: { 'Authorization': `Bearer ${token}` } } ); @@ -83,11 +85,13 @@ export function useExport(): UseExportReturn { setError(null); try { + const token = localStorage.getItem('auth_token'); const response = await axios.post( `/api/admin/exports/audit-trail?format=${format}`, {}, { responseType: "blob", + headers: { 'Authorization': `Bearer ${token}` } } );