17 lines
611 B
TypeScript
17 lines
611 B
TypeScript
import { NextRequest, NextResponse } from "next/server";
|
|
|
|
export async function POST(request: NextRequest) {
|
|
try {
|
|
const { password } = await request.json();
|
|
const correctPassword = process.env.APP_PASSWORD || "Semillero2026!";
|
|
|
|
if (password === correctPassword) {
|
|
return NextResponse.json({ success: true });
|
|
}
|
|
|
|
return NextResponse.json({ success: false, error: "Incorrect password" }, { status: 401 });
|
|
} catch (error) {
|
|
console.error("Auth API Error:", error);
|
|
return NextResponse.json({ success: false, error: "Internal Server Error" }, { status: 500 });
|
|
}
|
|
}
|