4.1 React Query 설치 및 Provider 구성 o

This commit is contained in:
koreacomp5
2025-10-09 15:13:12 +09:00
parent 8064837422
commit 55c0f6abb1
8 changed files with 113 additions and 4 deletions

View File

@@ -2,8 +2,13 @@ import { NextResponse } from "next/server";
import { loginSchema } from "@/lib/validation/auth";
import prisma from "@/lib/prisma";
import { verifyPassword } from "@/lib/password";
import { getClientKey, isRateLimited } from "@/lib/ratelimit";
export async function POST(req: Request) {
const key = getClientKey(req, "login");
if (isRateLimited(key, 5, 60_000)) {
return NextResponse.json({ error: "Too Many Requests" }, { status: 429 });
}
const body = await req.json();
const parsed = loginSchema.safeParse(body);
if (!parsed.success)