Hash Password

This commit is contained in:
headlesdev
2025-05-17 14:57:58 +02:00
parent e9fe5bb22a
commit 03db0eabad
4 changed files with 13 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
import { NextRequest, NextResponse } from "next/server";
import bcrypt from 'bcryptjs';
import prisma from "@/app/prisma";
interface Body {
@@ -21,7 +22,7 @@ export async function POST(request: NextRequest) {
username: body.username,
name: body.name,
email: body.email,
password: body.password,
password: await bcrypt.hash(body.password, 10),
},
});

View File