Use 'bcrypt-nodejs' package
This commit is contained in:
parent
c4fad94513
commit
316fba3c08
|
@ -32,7 +32,7 @@
|
|||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bcrypt": "^0.8.0",
|
||||
"bcrypt-nodejs": "0.0.3",
|
||||
"cheerio": "^0.17.0",
|
||||
"commander": "^2.3.0",
|
||||
"express": "^4.9.5",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
var ClientManager = new require("../clientManager");
|
||||
var bcrypt = require("bcrypt");
|
||||
var bcrypt = require("bcrypt-nodejs");
|
||||
var fs = require("fs");
|
||||
var program = require("commander");
|
||||
var mkdirp = require("mkdirp");
|
||||
|
@ -52,7 +52,8 @@ program
|
|||
|
||||
function add(manager, name, password) {
|
||||
console.log("");
|
||||
var hash = bcrypt.hashSync(password, 8);
|
||||
var salt = bcrypt.genSaltSync(8);
|
||||
var hash = bcrypt.hashSync(password, salt);
|
||||
manager.addUser(
|
||||
name,
|
||||
hash
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var bcrypt = require("bcrypt");
|
||||
var bcrypt = require("bcrypt-nodejs");
|
||||
var ClientManager = new require("../clientManager");
|
||||
var fs = require("fs");
|
||||
var program = require("commander");
|
||||
|
@ -25,7 +25,8 @@ program
|
|||
if (err) {
|
||||
return;
|
||||
}
|
||||
var hash = bcrypt.hashSync(password, 8);
|
||||
var salt = bcrypt.genSaltSync(8);
|
||||
var hash = bcrypt.hashSync(password, salt);
|
||||
user.password = hash;
|
||||
fs.writeFileSync(
|
||||
file,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
var _ = require("lodash");
|
||||
var bcrypt = require("bcrypt");
|
||||
var bcrypt = require("bcrypt-nodejs");
|
||||
var Client = require("./client");
|
||||
var ClientManager = require("./clientManager");
|
||||
var express = require("express");
|
||||
|
|
Loading…
Reference in New Issue