Replace entire repo content with code from /root/shahikitchen-google/
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { isMenuManagerEmail } from '@/domain/auth/menu-managers';
|
||||
import { getCustomerSession } from './customer-session';
|
||||
|
||||
export async function getMenuManagerSession() {
|
||||
const session = await getCustomerSession();
|
||||
if (!session || !isMenuManagerEmail(session.email)) return null;
|
||||
return session;
|
||||
}
|
||||
|
||||
export async function requireMenuManager(): Promise<NextResponse | null> {
|
||||
const session = await getMenuManagerSession();
|
||||
if (!session) {
|
||||
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user