Question: Please help if you can integrate into my code these two things that I need. 1. I need to integrate the authentication or statement of

Please help if you can integrate into my code these two things that I need. 1. I need to integrate the authentication or statement of email and password in the login with the existing ones in the database, and also the bcrypt. 2. I need to create a statement in which it says that if the email already exists in the database, go to login and otherwise complete the registrationPlease help if you can integrate into my code these two thingsthat I need. 1. I need to integrate the authentication or statement

4 mainjs is login.ejs let newrecord =1 req, body, firstnane, req. body. surname, req,body. enail, hash, db, queryisqlquery, newrecord, (err) =s f if lerri [f (3) return console.error(err.nessage) i) res, render[ "parents, ej 5", datal; 3i 3) 3i /l Add Child page app.get("/add_child", function (req, res) res.renderi"add_child.ejs", tineData); f): I/ // add child user app.postl"/add_child", function (req, res) let data = object,assigni(f, tineData, req,body ); console. logidata): let splquery = TNSERT TNT0 child5 frhild_name, child_device, usernane, passurdi VALUES (?, ?, ?, ?); rec, body. nene, req. bady.device, rep. body-username, req, body , password 1; db.query { sqlquery, newrecord, (err }{ if (err) s return consple.errorlerr.nessage]; res. render("parents.ejs", datai; f): If children fage app.get["/childlog", function (req, res) \{ res. renderi"childlog.ejs", tineDatal

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!