first version
This commit is contained in:
9
app/api/auth/route.ts
Normal file
9
app/api/auth/route.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
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 });
|
||||
}
|
||||
Reference in New Issue
Block a user