Add src/app/api/admin/login/route.ts

This commit is contained in:
2026-06-10 15:40:43 +00:00
parent 85487b2fb1
commit 83d4cfc0e0

View File

@@ -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 });
}
}