security: replace public PDF URLs with authenticated API route, private bucket
All checks were successful
Staging Build / build (push) Successful in 3m33s
All checks were successful
Staging Build / build (push) Successful in 3m33s
This commit is contained in:
@@ -227,9 +227,8 @@ export async function submitOrder(params: {
|
||||
if (uploadError) {
|
||||
console.error('PDF Upload Error:', uploadError)
|
||||
} else {
|
||||
const { data: publicUrlData } = supabase.storage.from('invoices').getPublicUrl(fileName)
|
||||
await supabase.from('orders').update({ pdf_url: publicUrlData.publicUrl }).eq('id', order.id)
|
||||
order.pdf_url = publicUrlData.publicUrl
|
||||
await supabase.from('orders').update({ pdf_url: fileName }).eq('id', order.id)
|
||||
order.pdf_url = fileName
|
||||
}
|
||||
|
||||
// 7. E-Mail mit PDF-Anhang an den Besteller senden
|
||||
@@ -655,9 +654,8 @@ export async function updateOrder(
|
||||
if (uploadError) {
|
||||
console.error('PDF Upload Error:', uploadError)
|
||||
} else {
|
||||
const { data: publicUrlData } = supabase.storage.from('invoices').getPublicUrl(fileName)
|
||||
await admin.from('orders').update({ pdf_url: publicUrlData.publicUrl }).eq('id', order.id)
|
||||
order.pdf_url = publicUrlData.publicUrl
|
||||
await admin.from('orders').update({ pdf_url: fileName }).eq('id', order.id)
|
||||
order.pdf_url = fileName
|
||||
}
|
||||
|
||||
// 4. E-Mail mit PDF-Anhang an den Besteller senden (Info über Änderung)
|
||||
|
||||
Reference in New Issue
Block a user