verify email

This commit is contained in:
Max Peintner
2023-05-22 11:48:18 +02:00
parent db7ba251ed
commit b169faad0e
12 changed files with 159 additions and 33 deletions

View File

@@ -6,9 +6,13 @@ export async function POST(request: NextRequest) {
if (body) {
const { userId, code } = body;
return verifyEmail(server, userId, code).then((resp) => {
return NextResponse.json(resp);
});
return verifyEmail(server, userId, code)
.then((resp) => {
return NextResponse.json(resp);
})
.catch((error) => {
return NextResponse.json(error, { status: 500 });
});
} else {
return NextResponse.error();
}