public/javascripts/updatePass.js
/**
 * Updates User Password in the Database
 */
Updates User Password in the Database
Updates User Password in the Database
function updatePass(username, callback) {
  let password = document.getElementById('newPass').value;
  let string = SQL`UPDATE employee_info
                 SET Password = ${ password },
                 WHERE Username = ${ username };`;
  pool.query(string,
      (err, res)=> {
        if(err) {
          callback(err);
        } else {
          callback(null);
		  alert("Password Updated Successfully!");
        }
  });
}
function updatePass ( username , callback ) { let password = document . getElementById ( 'newPass' ) . value ; let string = SQL ` ${ password } ${ username } ` ; pool . query ( string , ( err , res ) => { if ( err ) { callback ( err ) ; } else { callback ( null ) ; alert ( "Password Updated Successfully!" ) ; } } ) ; }
Updates User Password in the Database
Updates User Password in the Database
// hash the plaintext password //let hash = bcrypt.hashSync(document.getElementById('newPass').value);