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.
This commit is contained in:
arsam
2026-09-18 23:16:42 +03:30
parent 09bdb5ae96
commit be5e29fbc3
+13
View File
@@ -0,0 +1,13 @@
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 });
}