updated debug console logs
This commit is contained in:
parent
b4fb633c23
commit
a93237cf10
1 changed files with 3 additions and 3 deletions
|
@ -12,7 +12,7 @@ const { auth: { masterPassword } } = require('../../../../../config/siteConfig.j
|
||||||
const updateUserPassword = ({ ip, originalUrl, body }, res) => {
|
const updateUserPassword = ({ ip, originalUrl, body }, res) => {
|
||||||
let userRecord;
|
let userRecord;
|
||||||
const { userName, oldPassword, newPassword } = body;
|
const { userName, oldPassword, newPassword } = body;
|
||||||
logger.info('body:', body);
|
|
||||||
if (!masterPassword) {
|
if (!masterPassword) {
|
||||||
return res.status(400).json({
|
return res.status(400).json({
|
||||||
success: false,
|
success: false,
|
||||||
|
@ -38,10 +38,10 @@ const updateUserPassword = ({ ip, originalUrl, body }, res) => {
|
||||||
throw new Error('no user found');
|
throw new Error('no user found');
|
||||||
}
|
}
|
||||||
if (oldPassword === masterPassword) {
|
if (oldPassword === masterPassword) {
|
||||||
console.log('master password provided');
|
logger.debug('master password provided');
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.log('old password provided');
|
logger.debug('old password provided');
|
||||||
return userRecord.comparePassword(oldPassword);
|
return userRecord.comparePassword(oldPassword);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue