diff --git a/apps/admin/constants/cookieKey.ts b/apps/admin/constants/cookieKey.ts index 17227baa..6bd79aff 100644 --- a/apps/admin/constants/cookieKey.ts +++ b/apps/admin/constants/cookieKey.ts @@ -1,4 +1,4 @@ export const enum cookieKey { accessToken = "accessToken", - "middleware-executed" = "middleware-executed", + "admin-middleware-executed" = "admin-middleware-executed", } diff --git a/apps/admin/middleware.ts b/apps/admin/middleware.ts index d317378b..18600ef8 100644 --- a/apps/admin/middleware.ts +++ b/apps/admin/middleware.ts @@ -12,7 +12,7 @@ const middleware = async () => { const cookieStore = cookies(); const accessToken = cookieStore.get(cookieKey.accessToken)?.value; const middlewareExecuted = cookieStore.get( - cookieKey["middleware-executed"] + cookieKey["admin-middleware-executed"] )?.value; if (!accessToken) { @@ -26,7 +26,7 @@ const middleware = async () => { return NextResponse.redirect(new URL("/auth", clientUrl)); } const response = NextResponse.next(); - response.cookies.set(cookieKey["middleware-executed"], "true", { + response.cookies.set(cookieKey["admin-middleware-executed"], "true", { httpOnly: true, secure: true, sameSite: "lax",