1
0
mirror of https://github.com/microsoft/TypeScript-Node-Starter.git synced 2025-11-08 14:47:28 +00:00

Fix TS compiler error

This commit is contained in:
Peter Blazejewicz
2019-06-22 22:16:24 +02:00
parent 284a8ddddf
commit 5a11f7e381

View File

@@ -54,7 +54,7 @@ const userSchema = new mongoose.Schema({
* Password hash middleware.
*/
userSchema.pre("save", function save(next) {
const user = this;
const user = this as UserDocument;
if (!user.isModified("password")) { return next(); }
bcrypt.genSalt(10, (err, salt) => {
if (err) { return next(err); }