This commit is contained in:
Jack Mechem 2026-05-01 16:21:50 -07:00
parent c991fe7b6d
commit e6b5fed399
8 changed files with 6647 additions and 6623 deletions

View file

@ -13,7 +13,8 @@ export async function POST(req: NextRequest) {
});
if (!res.ok) {
return NextResponse.json({ error: "Invalid credentials" }, { status: 401 });
const text = await res.text();
return NextResponse.json({ error: text }, { status: 401 });
}
// Returns { session_id, challenge } — browser completes the WebAuthn step

View file

@ -1,6 +1,11 @@
import { NextRequest, NextResponse } from "next/server";
const ENROLLMENT_OPEN = process.env.ENROLLMENT_OPEN === "true";
export async function POST(req: NextRequest) {
if (!ENROLLMENT_OPEN) {
return new NextResponse(null, { status: 404 });
}
const body = await req.json();
const res = await fetch("http://localhost:3001/auth/register/finish", {

View file

@ -1,6 +1,11 @@
import { NextRequest, NextResponse } from "next/server";
const ENROLLMENT_OPEN = process.env.ENROLLMENT_OPEN === "true";
export async function POST(req: NextRequest) {
if (!ENROLLMENT_OPEN) {
return new NextResponse(null, { status: 404 });
}
const { username, password } = await req.json();
const res = await fetch("http://localhost:3001/auth/register/start", {