fix: Use hashPassword utility instead of dynamic bcrypt import

This commit is contained in:
fullsizemalt 2026-01-12 15:35:13 -08:00
parent 458913bdf8
commit 555a22b846

View file

@ -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({