feat: add authentication token handling for design persistence

This commit is contained in:
Frank John Begornia
2025-11-21 22:45:08 +08:00
parent 701fc25630
commit 15b3bd9465
2 changed files with 8 additions and 0 deletions

View File

@@ -128,8 +128,12 @@ const persistDesign = async (designId: string, design: ExportedDesign) => {
),
]);
// Get Firebase ID token for authentication
const idToken = user.value ? await user.value.getIdToken() : null;
await $fetch("/api/designs", {
method: "POST",
headers: idToken ? { Authorization: `Bearer ${idToken}` } : {},
body: {
designId,
templateId: design.templateId,