diff --git a/ghost/security/lib/password.js b/ghost/security/lib/password.js index 4f4580f9fd..cb0a0e308a 100644 --- a/ghost/security/lib/password.js +++ b/ghost/security/lib/password.js @@ -1,6 +1,13 @@ const bcrypt = require('bcryptjs'); + +let HASH_ROUNDS = 10; + +if (process.env.NODE_ENV.startsWith('testing')) { + HASH_ROUNDS = 1; +} + module.exports.hash = async function hash(plainPassword) { - const salt = await bcrypt.genSalt(); + const salt = await bcrypt.genSalt(HASH_ROUNDS); return bcrypt.hash(plainPassword, salt); };