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

@@ -27,6 +27,9 @@ export default defineEventHandler(async (event) => {
});
}
// Extract the authorization token from the incoming request
const authHeader = getHeader(event, "authorization");
const payload = {
designId: body.designId,
templateId: body.templateId,
@@ -43,6 +46,7 @@ export default defineEventHandler(async (event) => {
const result = await $fetch("/designs", {
baseURL: backendUrl,
method: "POST",
headers: authHeader ? { Authorization: authHeader } : {},
body: payload,
});