Clean up middleware, add security-headers to non-Zammad pages

This commit is contained in:
Darren Clarke 2024-09-04 12:09:28 +02:00
parent 027aac3a92
commit 8c6e954fdf
9 changed files with 81 additions and 62 deletions

View file

@ -1,5 +1,4 @@
import { getServerSession } from "app/_lib/authentication";
import { redirect } from "next/navigation";
import { cookies } from "next/headers";
const getHeaders = async () => {
@ -8,8 +7,6 @@ const getHeaders = async () => {
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
// @ts-ignore
"X-CSRF-Token": session.user.zammadCsrfToken,
"X-Browser-Fingerprint": `${session.expires}`,
Cookie: allCookies
.map((cookie: any) => `${cookie.name}=${cookie.value}`)