create
This commit is contained in:
@@ -5,8 +5,9 @@ const login = (body) => {
|
||||
return Operador.findOne({ where: { nombre: body.nombre } })
|
||||
.then((res) => {
|
||||
if (res) {
|
||||
if (!bcrypt.compareSync(body.password, res.password))
|
||||
if (!bcrypt.compareSync(body.password, res.password)) {
|
||||
throw new Error('El usuario o contraseña son incorrectos.')
|
||||
}
|
||||
return { res }
|
||||
}
|
||||
throw new Error('El usuario o contraseña son incorrectos.')
|
||||
@@ -15,3 +16,5 @@ const login = (body) => {
|
||||
}
|
||||
|
||||
module.exports = login
|
||||
|
||||
// login({ nombre: 'lemuel', password: 'hola' })
|
||||
|
||||
Reference in New Issue
Block a user