V1 bingo
Deploy / build-and-deploy (push) Failing after 2m53s

This commit is contained in:
2026-06-14 21:29:43 +03:00
commit 05677924b5
55 changed files with 10816 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import { NextRequest, NextResponse } from "next/server";
import { registerUser } from "@/lib/auth";
export async function POST(req: NextRequest) {
try {
const { nickname, password } = await req.json();
if (!nickname || !password) {
return NextResponse.json({ error: "Nickname and password required" }, { status: 400 });
}
if (nickname.length < 2 || nickname.length > 20) {
return NextResponse.json({ error: "Nickname 2-20 characters" }, { status: 400 });
}
if (password.length < 4) {
return NextResponse.json({ error: "Password min 4 characters" }, { status: 400 });
}
const result = await registerUser(nickname, password);
if ("error" in result) {
return NextResponse.json(result, { status: 409 });
}
return NextResponse.json(result);
} catch {
return NextResponse.json({ error: "Registration failed" }, { status: 500 });
}
}