English 中文(简体)
NodeJS: Bcode: Error: 非法论点:不明确,扼杀
原标题:NodeJS: Bcrypt: Error: Illegal arguments: undefined, string

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")

    });
问题回答

参看@epascarello。 您通过用户收集工作,并试图根据您的电子邮件找到用户,这些电子邮件应当与Aync一起进行总结,等待打电话。 然后发现,等待用户使用的这种方式是用<条码>b 加密/编码>对密码进行补充。

exports.PostLogin = async (req, res, next) => {

    const password = req.body.password
    const email = req.body.email

    await User.findOne({ where: {email : email}})
    .then((user) => {
    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")

    });




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签