Mist, jetzt vielleicht

This commit is contained in:
rxf
2026-03-11 20:33:19 +01:00
parent bc235e4e32
commit a949ebcdc8
28 changed files with 1666 additions and 74 deletions

16
app/api/check/route.ts Normal file
View File

@@ -0,0 +1,16 @@
import { NextRequest, NextResponse } from 'next/server';
import { doCheckAndMail } from '@/lib/mailService';
// Einfacher Shared-Secret-Schutz
const SECRET = process.env.CHECK_SECRET || '';
export async function GET(req: NextRequest) {
if (SECRET) {
const token = req.nextUrl.searchParams.get('secret');
if (token !== SECRET) {
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
}
}
const result = await doCheckAndMail();
return NextResponse.json({ ok: true, result });
}