Replace entire repo content with code from /root/shahikitchen-google/

This commit is contained in:
root
2026-07-03 02:51:15 +00:00
parent c8b7dc95e4
commit 8ccf033329
79 changed files with 7611 additions and 439 deletions
+28
View File
@@ -0,0 +1,28 @@
import { NextResponse } from 'next/server';
import { cookies } from 'next/headers';
import {
CUSTOMER_SESSION_COOKIE,
getClearedCustomerSessionCookieOptions,
} from '@/infrastructure/auth/customer-session';
import {
ADMIN_SESSION_COOKIE,
getAdminSessionCookieOptions,
} from '@/infrastructure/auth/admin-session';
export async function POST() {
const cookieStore = await cookies();
const clearedCustomer = getClearedCustomerSessionCookieOptions();
const clearedAdmin = { ...getAdminSessionCookieOptions(), maxAge: 0, expires: new Date(0) };
cookieStore.set(CUSTOMER_SESSION_COOKIE, '', clearedCustomer);
cookieStore.delete({ name: CUSTOMER_SESSION_COOKIE, path: '/' });
cookieStore.set(ADMIN_SESSION_COOKIE, '', clearedAdmin);
cookieStore.delete({ name: ADMIN_SESSION_COOKIE, path: '/' });
const response = NextResponse.json({ ok: true });
response.cookies.set(CUSTOMER_SESSION_COOKIE, '', clearedCustomer);
response.cookies.set(ADMIN_SESSION_COOKIE, '', clearedAdmin);
response.headers.set('Cache-Control', 'no-store');
return response;
}
+16
View File
@@ -0,0 +1,16 @@
import { NextResponse } from 'next/server';
import { isMenuManagerEmail } from '@/domain/auth/menu-managers';
import { getCustomerSession } from '@/infrastructure/auth/customer-session';
export const dynamic = 'force-dynamic';
export async function GET() {
const session = await getCustomerSession();
const email = session?.email ?? null;
return NextResponse.json({
authenticated: Boolean(session),
email,
name: session?.name ?? null,
isMenuManager: isMenuManagerEmail(email),
});
}