diff --git a/src/app/api/admin/login/route.ts b/src/app/api/admin/login/route.ts new file mode 100644 index 0000000..9f493e2 --- /dev/null +++ b/src/app/api/admin/login/route.ts @@ -0,0 +1,13 @@ +import { NextRequest, NextResponse } from 'next/server'; + +export async function POST(req: NextRequest) { + const { email, password } = await req.json(); + + if (email === 'admin@demo.com' && password === 'Admin@123') { + // In a real app, generate a JWT token or create a session. + // For this mock, we'll just indicate success. + return NextResponse.json({ message: 'Login successful', token: 'mock-admin-token' }, { status: 200 }); + } else { + return NextResponse.json({ message: 'Invalid credentials' }, { status: 401 }); + } +} \ No newline at end of file