Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
xowns4817 committed Apr 24, 2021
2 parents 1839f5c + f399cbe commit 7c460ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/userControllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ const changePassword = async(req, res) => {
const temporaryPassword = async(req, res) => {
logger.info(`Sending user's password of [${req.body.email}] to Email...`);
const tempPassword = Math.random().toString(36).slice(2);
await sendEmail(req.body.email, tempPassword);
const salt = cryptoHelper.salt();
const digest = cryptoHelper.digest(tempPassword, salt);
const [updatedCnt] = await UserSchema.changeUserPassword(
Expand All @@ -226,6 +225,7 @@ const temporaryPassword = async(req, res) => {
salt
);
if(updatedCnt) {
await sendEmail(req.body.email, tempPassword);
res.json({rc: 200, rcmsg: resString.SUCCESS});
}else{
throw new NotFound(resString.ERR_EMAIL);
Expand Down

0 comments on commit 7c460ab

Please sign in to comment.