How to use the bcryptjs.compareAsync function in bcryptjs

To help you get started, we’ve selected a few bcryptjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github leafingio / monolithic-node-seed / server / modules / User / schemas.js View on Github external
userSchema.methods.validPassword = function (password) {
	return bcrypt
	.compareAsync(password, this.password)
	.then((result, err) => {
		/* istanbul ignore if */
		if (err) throw new Error(err);
		return result;