4.1 React Query 설치 및 Provider 구성 o
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user