mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 07:53:00 +00:00
21 lines
559 B
TypeScript
21 lines
559 B
TypeScript
import { setEmail, server } from "#/lib/zitadel";
|
|
import { NextRequest, NextResponse } from "next/server";
|
|
|
|
export async function POST(request: NextRequest) {
|
|
const body = await request.json();
|
|
if (body) {
|
|
const { userId, code } = body;
|
|
|
|
// replace with resend Mail method once its implemented
|
|
return setEmail(server, userId)
|
|
.then((resp) => {
|
|
return NextResponse.json(resp);
|
|
})
|
|
.catch((error) => {
|
|
return NextResponse.json(error, { status: 500 });
|
|
});
|
|
} else {
|
|
return NextResponse.error();
|
|
}
|
|
}
|