Added register

This commit is contained in:
PxlLoewe
2025-01-27 01:45:03 +01:00
parent e30c28a66f
commit 239e9b8302
18 changed files with 602 additions and 85 deletions

View File

@@ -0,0 +1,17 @@
'use server';
import { prisma, Prisma } from '@repo/db';
import bcrypt from 'bcryptjs';
export const register = async ({
password,
...user
}: Prisma.UserCreateInput) => {
const hashedPassword = await bcrypt.hash(password, 15);
const newUser = prisma.user.create({
data: {
...user,
password: hashedPassword,
},
});
return newUser;
};