www.un.org/Depts/DGACM/index_spanish.htm 这是我从控制人那里发出的守则的一部分,即使用该记录仪进行验证,因此,所有材料都正确输入数据库及其加密权利,但此时正试图提交用户数据,从而无法验证密码,并说密码中的错误。 相比之下,如果说错了,那就应当改用我的家,而方案则倒塌。
Error: Illegal arguments: undefined, string
at _async (C:UsersCHINODesktopSistema-Pre-Escolar-Manitas-De-Oro-main (1)Sistema-Pre-Escolar-Manitas-De-Oro-main
ode_modulescryptjsdistcrypt.js:286:46)
at C:UsersCHINODesktopSistema-Pre-Escolar-Manitas-De-Oro-main (1)Sistema-Pre-Escolar-Manitas-De-Oro-main
ode_modulescryptjsdistcrypt.js:307:17
at new Promise (<anonymous>)
at Object.bcrypt.compare (C:UsersCHINODesktopSistema-Pre-Escolar-Manitas-De-Oro-main (1)Sistema-Pre-Escolar-Manitas-De-Oro-main
ode_modulescryptjsdistcrypt.js:306:20)
at C:UsersCHINODesktopSistema-Pre-Escolar-Manitas-De-Oro-main (1)Sistema-Pre-Escolar-Manitas-De-Oro-maincontrollersauthController.js:31:6
at processTicksAndRejections (node:internal/process/task_queues:96:5)
<>AuthController.js>:
exports.PostLogin = (req, res, next) => {
const password = req.body.password
const email = req.body.email
User.findOne({ where: {email : email}})
.then((user) => {
if (!user) {
flash.req("errors","Ha ocurrido un error al momento de ingresar el Correo electronico")
return res.redirect("/login")
}
bcrypt
.compare(password, user.password)
.then((result) =>{
if (result){
req.session.IsloggedIn=true
req.session.user = user
return req.session.save((err) =>
{
flash.req("errors","Contreseña invalida")
console.log("Error al momento de compare",err)
res.redirect("/")
});
}
res.redirect("/login")
});