drfaustusfade / ngm-reportDesk

The workdesk for ReportHub
0 stars 1 forks source link

User Last Logged In #7

Open drfaustusfade opened 3 years ago

drfaustusfade commented 3 years ago

add last logged in attribute, as updatedAt could be due to other reasons

fakhrihawari commented 3 years ago

user already have las logged in attribute right?

Screen Shot 2020-12-24 at 11 10 39
drfaustusfade commented 3 years ago

it was removed at some point that should be set for better tracking of user loggins on login and password reset also, scripts to update user collection with last_logged_in if none out of updatedAt is needed

fakhrihawari commented 3 years ago

so for the scripts just set last_logged_in same as updatedAt ?

updated on branch : https://github.com/fakhrihawari/ngm-reportHub/tree/add-atribute-last-loggedin https://github.com/fakhrihawari/ngm-reportEngine/tree/add-lastlogged-fo-user

drfaustusfade commented 3 years ago

so for the scripts just set last_logged_in same as updatedAt ? yes

drfaustusfade commented 3 years ago

updated on branch : https://github.com/fakhrihawari/ngm-reportHub/tree/add-atribute-last-loggedin https://github.com/fakhrihawari/ngm-reportEngine/tree/add-lastlogged-fo-user

  • right, please also check for other User Collection addition of last_logged_in attribute
  • import moment on top of the file rather than on functions
fakhrihawari commented 3 years ago

updated on branch : https://github.com/fakhrihawari/ngm-reportHub/tree/add-atribute-last-loggedin https://github.com/fakhrihawari/ngm-reportEngine/tree/add-lastlogged-fo-user

  • right, please also check for other User Collection addition of last_logged_in attribute
  • import moment on top of the file rather than on functions

okay

fakhrihawari commented 3 years ago

Sripts db.user.find({"last_logged_in":{$exists: false}}).forEach(function(u){u.last_logged_in = u.updatedAt; db.user.save(u)}); db.userhistory.find({"last_logged_in":{$exists: false}}).forEach(function(u){u.last_logged_in = u.updatedAt; db.userhistory.save(u)}); db.userloginhistory.find({"last_logged_in":{$exists: false}}).forEach(function(u){u.last_logged_in = u.updatedAt; db.userloginhistory.save(u)});

fakhrihawari commented 3 years ago

updated on branch : https://github.com/fakhrihawari/ngm-reportHub/tree/add-atribute-last-loggedin https://github.com/fakhrihawari/ngm-reportEngine/tree/add-lastlogged-fo-user

  • right, please also check for other User Collection addition of last_logged_in attribute
  • import moment on top of the file rather than on functions

you mean in another user collection in another db?

drfaustusfade commented 3 years ago

updated on branch : https://github.com/fakhrihawari/ngm-reportHub/tree/add-atribute-last-loggedin https://github.com/fakhrihawari/ngm-reportEngine/tree/add-lastlogged-fo-user

  • right, please also check for other User Collection addition of last_logged_in attribute
  • import moment on top of the file rather than on functions

you mean in another user collection in another db?

if on other user-related collections that attribute should be added, like UserLoginHistory

fakhrihawari commented 3 years ago

updated on branch : https://github.com/fakhrihawari/ngm-reportHub/tree/add-atribute-last-loggedin https://github.com/fakhrihawari/ngm-reportEngine/tree/add-lastlogged-fo-user

  • right, please also check for other User Collection addition of last_logged_in attribute
  • import moment on top of the file rather than on functions

you mean in another user collection in another db?

if on other user-related collections that attribute should be added, like UserLoginHistory

okay