fix: Use hashPassword utility instead of dynamic bcrypt import
This commit is contained in:
parent
458913bdf8
commit
555a22b846
1 changed files with 3 additions and 3 deletions
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue