diff --git a/server/models/User.js b/server/models/User.js index 788e720..5092e2a 100644 --- a/server/models/User.js +++ b/server/models/User.js @@ -5,7 +5,7 @@ const userSchema = new Schema({ username: String, email: String, password: String, - registered: String, + registered: Date, lastLogin: Date }); diff --git a/server/services/passport.js b/server/services/passport.js index e5b6fb2..9c3b1ed 100644 --- a/server/services/passport.js +++ b/server/services/passport.js @@ -25,7 +25,8 @@ passport.use('local', new LocalStrategy( .then(user => { if (!user) { 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.hash(newUser.password, salt, (err, hash) => { if (err) throw err;