helpers/passportStrategies.js
// set lastSeen property of user upon successful auth 
set lastSeen property of user upon successful auth
set lastSeen property of user upon successful auth
function updateLastSeen (username) {
  const User = mongoose.model('User');
  User.updateOne({username: username},{$set: {lastSeen: moment(new Date).unix()}}, (err, data) => {
    if (err) console.log(err);
    console.log(`lastSeen timestamp updated for user ${username}`);
  });
}
function updateLastSeen ( username ) { const User = mongoose . model ( 'User' ) ; User . updateOne ( { username : username } , { $set : { lastSeen : moment ( new Date ) . unix ( ) } } , ( err , data ) => { if ( err ) console . log ( err ) ; console . log ( ` ${ username } ` ) ; } ) ; }
set lastSeen property of user upon successful auth
set lastSeen property of user upon successful auth