9 lines
323 B
TypeScript
9 lines
323 B
TypeScript
import { NextRequest, NextResponse } from 'next/server';
|
|
|
|
export async function POST(req: NextRequest) {
|
|
const { password } = await req.json();
|
|
if (password === process.env.APP_PASSWORD) {
|
|
return NextResponse.json({ success: true });
|
|
}
|
|
return NextResponse.json({ error: 'Invalid password' }, { status: 401 });
|
|
} |