Files
arsam be5e29fbc3 Import source: vault/app/api/auth/captcha/route
Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
2026-09-18 23:16:42 +03:30

14 lines
497 B
TypeScript

import { NextResponse } from "next/server";
import { createCaptchaChallenge } from "@/lib/server-security";
import { jsonError } from "@/lib/server-api";
import { isRateLimited } from "@/lib/server-rate-limit";
export async function GET(request: Request) {
if (await isRateLimited(request, "captcha", 60, 60_000)) {
return jsonError("Too many captcha requests. Try again shortly.", 429);
}
const challenge = await createCaptchaChallenge();
return NextResponse.json({ challenge });
}