Token-Cookie pfadunabhängig speichern

This commit is contained in:
2026-06-02 11:54:18 +02:00
parent 8d821a6802
commit 79d620d9c1
3 changed files with 29 additions and 6 deletions

View File

@@ -460,7 +460,7 @@ async function downloadAttachment(attachment: NonNullable<EmailMessage["attachme
const apiBase = String(runtimeConfig.public.apiBase || "").replace(/\/$/, "")
const path = `/api/email/attachments/${attachment.id}/download`
const downloadUrl = new URL(apiBase ? `${apiBase}${path}` : path, window.location.origin)
const token = useCookie("token").value
const token = useCookie<string | null>("token", { path: "/" }).value
if (token) {
downloadUrl.searchParams.set("downloadToken", token)