|
@ -25,7 +25,8 @@ passport.use('local', new LocalStrategy( |
|
|
.then(user => { |
|
|
.then(user => { |
|
|
if (!user) { |
|
|
if (!user) { |
|
|
const lastLogin = Date.now() |
|
|
const lastLogin = Date.now() |
|
|
const newUser = new User({username, password, lastLogin}); |
|
|
const registered = lastLogin |
|
|
|
|
|
const newUser = new User({username, password, registered, lastLogin}); |
|
|
bcrypt.genSalt(10, (err, salt) => { |
|
|
bcrypt.genSalt(10, (err, salt) => { |
|
|
bcrypt.hash(newUser.password, salt, (err, hash) => { |
|
|
bcrypt.hash(newUser.password, salt, (err, hash) => { |
|
|
if (err) throw err; |
|
|
if (err) throw err; |
|
|