I've had this working before, but now it's broken for some reason. I'm using MariaDB
as a database, and need to compare passwords, but it's giving me an error Unexpected Identifier on "bcrypt" after await
. When I remove the await
, it works, but even if the password is wrong. What am I doing wrong here? Thanks
Edit: I forgot to include the user info after .then. I must of deleted it with some comments when I posted this question. I added it back. Here is my code:
//data connection pool
const pool = require('../models/db');
const { handleError, ErrorHandler } = require('../helpers/error');
const bcrypt = require('bcrypt');
module.exports = (req, res) => {
//destructuring assignment