From be5e29fbc3c6545303b5770b5aa419e272c53044 Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:16:42 +0330 Subject: [PATCH] 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. --- vault/app/api/auth/captcha/route.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 vault/app/api/auth/captcha/route.ts diff --git a/vault/app/api/auth/captcha/route.ts b/vault/app/api/auth/captcha/route.ts new file mode 100644 index 0000000..3eafbe1 --- /dev/null +++ b/vault/app/api/auth/captcha/route.ts @@ -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 }); +}