diff --git a/routes/account.ts b/routes/account.ts index da1b2fb9e4907cfb424dc8edd6ae085be6beba37..68c3ca613a942c9b1d8f75e072b07d0f4377d7c8 100644 --- a/routes/account.ts +++ b/routes/account.ts @@ -41,7 +41,7 @@ export = function (app:any, config:any, passport:any, lang:string) { // Service Provider private key decryptionPvk: fs.readFileSync(__dirname + '/cert/key.pem', 'utf8'), // Service Provider Certificate - privateCert: fs.readFileSync(__dirname + '/cert/key.pem', 'utf8'), + privateKey: fs.readFileSync(__dirname + '/cert/key.pem', 'utf8'), // Identity Provider's public key cert: fs.readFileSync(__dirname + '/cert/cert_idp.pem', 'utf8'), @@ -295,12 +295,12 @@ export = function (app:any, config:any, passport:any, lang:string) { let newPwd = req.body.inputNewPwd let retypePwd = req.body.inputConfirm - dbconn.user.query('SELECT password FROM credential WHERE user_id='+loggedInUser.getId(), function (err, rows, fields) { + dbconn.user.query('SELECT password FROM credential WHERE user_id='+loggedInUser.getId(), function (err:any, rows:any) { if (err) { console.error(err) res.status(500).render(lang+'/500', { error: err }) } - var userPwd = rows[0].password + let userPwd = rows[0].password // check if the password is correct bcrypt.compare(currPwd, userPwd, function(err, isMatch) {