kasvith / express-mongo-jwt-boilerplate

Express Mongo JsonWebToken boilerplate
103 stars 43 forks source link

Thanks for the code- and a question about the async-await usage #29

Open AsafShochet opened 4 years ago

AsafShochet commented 4 years ago

hi, I found your boiler plate very helpful, thanks.

I have a question, why did you use asyn in the user.model.js file, but there's no "await" inside the function. just curious. for example - here:

userSchema.pre('save', async function save (next) { try { if (!this.isModified('password')) { return next() }

this.password = bcrypt.hashSync(this.password)

return next()

} catch (error) { return next(error) } })

macaframa commented 3 years ago

They should use linter to deal with this.

kasvith commented 3 years ago

Sorry, it was a mistake.