Browse Source

Merge branch 'develop' of git.digitaltelepresence.com:digital-telepresence/dtp-base into develop

develop
Rob Colbert 2 years ago
parent
commit
30675e2ce7
  1. 19
      app/services/user.js

19
app/services/user.js

@ -667,6 +667,25 @@ class UserService extends SiteService {
);
}
async updatePassword (user, password) {
const { crypto: cryptoService } = this.dtp.services;
const passwordSalt = uuidv4();
const passwordHash = cryptoService.maskPassword(passwordSalt, password);
this.log.info('updating user password', { userId: user._id });
await User.updateOne(
{ _id: user._id },
{
$set: {
passwordSalt: passwordSalt,
password: passwordHash,
}
}
);
}
/**
* Updates the `lastAnnouncement` field of a User to the `created` date of the
* specified announcement (for tracking last-seen announcements).

Loading…
Cancel
Save