This repository was archived by the owner on Dec 14, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 1+ const bcrypt = require ( 'bcryptjs' ) ;
2+ const saltRounds = process . env . NODE_ENV == 'test' ? 5 : 12 ;
3+
4+ const encodePassword = async input => {
5+ const salt = await bcrypt . genSalt ( saltRounds ) ;
6+
7+ return await bcrypt . hash ( input , salt ) ;
8+ } ;
9+
10+ module . exports = { encodePassword } ;
Original file line number Diff line number Diff line change 2828 },
2929 "dependencies" : {
3030 "async" : " 0.9.0" ,
31+ "bcryptjs" : " 2.4.3" ,
3132 "camelcase" : " ^4.1.0" ,
3233 "cp-i18n-lib" : " git+https://github.com/CoderDojo/cp-i18n-lib.git" ,
3334 "cp-logs-lib" : " git://github.com/CoderDojo/cp-logs-lib#1.1.0" ,
Original file line number Diff line number Diff line change @@ -479,6 +479,11 @@ bcrypt-pbkdf@^1.0.0:
479479 dependencies :
480480 tweetnacl "^0.14.3"
481481
482+ 483+ version "2.4.3"
484+ resolved "https://registry.yarnpkg.com/bcryptjs/-/bcryptjs-2.4.3.tgz#9ab5627b93e60621ff7cdac5da9733027df1d0cb"
485+ integrity sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms=
486+
482487483488 version "0.3.1"
484489 resolved "https://registry.yarnpkg.com/big-number/-/big-number-0.3.1.tgz#ac73020c0a59bb79eb17c2ce2db77f77d974e013"
You can’t perform that action at this time.
0 commit comments