Implementar modulo de Auth
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import bcrypt from "bcrypt";
|
||||
import userModel from "./user.model";
|
||||
|
||||
export class UserService {
|
||||
@ -20,6 +21,13 @@ export class UserService {
|
||||
async create(
|
||||
data:any
|
||||
) {
|
||||
const passwordHash = await bcrypt.hash(
|
||||
data.passwordHash,
|
||||
10
|
||||
);
|
||||
|
||||
data.passwordHash = passwordHash;
|
||||
|
||||
return await userModel.create(data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user