diff --git a/apps/scandic-web/middlewares/webView.ts b/apps/scandic-web/middlewares/webView.ts index 972945b91..a87f3474c 100644 --- a/apps/scandic-web/middlewares/webView.ts +++ b/apps/scandic-web/middlewares/webView.ts @@ -135,7 +135,14 @@ async function handleWebviewRewrite({ const path = nextUrl.pathname if (myStayWebviews.includes(path)) { - return NextResponse.next({ request: { headers } }) + return NextResponse.next({ + request: { headers }, + ...(setCookie && { + headers: { + "Set-Cookie": `webviewToken=${decryptedData}; Secure; HttpOnly; Path=/; SameSite=Strict;`, + }, + }), + }) } const pathNameWithoutLang = path.replace(`/${lang}/webview`, "")