Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async function login(email, pass, callback){
- console.log("pass ", pass)
- connection.query(`SELECT * FROM account WHERE email=? LIMIT 1;`, [email], function (err, rows, fields) {
- if (err) throw err
- console.log("rows", typeof rows[0], rows[0])
- if(rows[0] === undefined){
- callback(false)
- return
- }
- console.log("user id: ", rows[0].id)
- var dbPassword = rows[0].password
- var userID = rows[0].id
- bcrypt.compare(pass, dbPassword, function(err, result) {
- callback(result, userID)
- });
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement