mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 14:55:24 +02:00
Comprehensive audit: Replace backend JWT dependency universally with anon key and strict cache rules
This commit is contained in:
@@ -40,6 +40,9 @@ export default async function handler(req, res) {
|
|||||||
body: JSON.stringify({ path: '/CRAZE GmbH/Sales Reports/Data Matrix.xlsx' })
|
body: JSON.stringify({ path: '/CRAZE GmbH/Sales Reports/Data Matrix.xlsx' })
|
||||||
});
|
});
|
||||||
const data = await fileInfo.json();
|
const data = await fileInfo.json();
|
||||||
|
res.setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, proxy-revalidate');
|
||||||
|
res.setHeader('Pragma', 'no-cache');
|
||||||
|
res.setHeader('Expires', '0');
|
||||||
return res.json({ rev: data.rev, size: data.size, server_modified: data.server_modified });
|
return res.json({ rev: data.rev, size: data.size, server_modified: data.server_modified });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return res.status(500).json({ error: err.message });
|
return res.status(500).json({ error: err.message });
|
||||||
|
|||||||
+4
-4
@@ -47,7 +47,7 @@ export async function saveRowToSupabase(articleNo: string, rowData: ExcelRow, to
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'apikey': SUPABASE_KEY,
|
'apikey': SUPABASE_KEY,
|
||||||
'Authorization': `Bearer ${token || SUPABASE_KEY}`,
|
'Authorization': `Bearer ${SUPABASE_KEY}`,
|
||||||
'Prefer': 'resolution=merge-duplicates'
|
'Prefer': 'resolution=merge-duplicates'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -100,7 +100,7 @@ export async function saveHistoryEntry(
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'apikey': SUPABASE_KEY,
|
'apikey': SUPABASE_KEY,
|
||||||
'Authorization': `Bearer ${token || SUPABASE_KEY}`,
|
'Authorization': `Bearer ${SUPABASE_KEY}`,
|
||||||
'Prefer': 'return=minimal'
|
'Prefer': 'return=minimal'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -178,7 +178,7 @@ export async function deleteHistoryEntry(id: string, token?: string): Promise<bo
|
|||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
headers: {
|
headers: {
|
||||||
'apikey': SUPABASE_KEY,
|
'apikey': SUPABASE_KEY,
|
||||||
'Authorization': `Bearer ${token || SUPABASE_KEY}`
|
'Authorization': `Bearer ${SUPABASE_KEY}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -199,7 +199,7 @@ export async function resetAllPendingRows(token?: string): Promise<boolean> {
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'apikey': SUPABASE_KEY,
|
'apikey': SUPABASE_KEY,
|
||||||
'Authorization': `Bearer ${token || SUPABASE_KEY}`,
|
'Authorization': `Bearer ${SUPABASE_KEY}`,
|
||||||
'Prefer': 'return=minimal'
|
'Prefer': 'return=minimal'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({ status: 'synced' })
|
body: JSON.stringify({ status: 'synced' })
|
||||||
|
|||||||
Reference in New Issue
Block a user