diff --git a/backend/src/controllers/users.controller.ts b/backend/src/controllers/users.controller.ts index cf17200..1fb1e05 100644 --- a/backend/src/controllers/users.controller.ts +++ b/backend/src/controllers/users.controller.ts @@ -1,4 +1,5 @@ import { FastifyRequest, FastifyReply } from 'fastify'; +import { hashPassword } from '../utils/password'; export const getUsers = async (request: FastifyRequest, reply: FastifyReply) => { // ... existing implementation ... @@ -83,9 +84,8 @@ export const createUser = async (request: FastifyRequest, reply: FastifyReply) = return reply.code(409).send({ message: 'User with this email already exists' }); } - // Hash password with bcrypt - const bcrypt = await import('bcrypt'); - const hashedPassword = await bcrypt.hash(data.password, 10); + // Hash password + const hashedPassword = await hashPassword(data.password); // Create user const user = await request.server.prisma.user.create({