mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 06:52:24 +00:00
21 lines
522 B
TypeScript
21 lines
522 B
TypeScript
import { addHumanUser, server } from "#/lib/zitadel";
|
|
import { NextRequest, NextResponse } from "next/server";
|
|
|
|
export async function POST(request: NextRequest) {
|
|
const body = await request.json();
|
|
console.log(body);
|
|
if (body) {
|
|
const { email, password, firstName, lastName } = body;
|
|
|
|
const userId = await addHumanUser(server, {
|
|
email: email,
|
|
firstName,
|
|
lastName,
|
|
password: password,
|
|
});
|
|
return NextResponse.json({ userId });
|
|
} else {
|
|
return NextResponse.error();
|
|
}
|
|
}
|