diff --git a/Packages/active-entry/lib/ActiveEntry.js b/Packages/active-entry/lib/ActiveEntry.js index de1d4bab7..1a15fa509 100755 --- a/Packages/active-entry/lib/ActiveEntry.js +++ b/Packages/active-entry/lib/ActiveEntry.js @@ -367,6 +367,8 @@ ActiveEntry.resetPassword = function(passwordValue, confirmPassword) { return; } Session.set('_resetPasswordToken', null); + // Update last login time + Meteor.call("updateLastLoginDate"); var ActiveEntryConfig = Session.get('Photonic.ActiveEntry'); Router.go(ActiveEntryConfig.signIn.destination); }); diff --git a/Packages/active-entry/server/methods.js b/Packages/active-entry/server/methods.js index 5225148e9..f11a5e7bc 100644 --- a/Packages/active-entry/server/methods.js +++ b/Packages/active-entry/server/methods.js @@ -127,8 +127,12 @@ Meteor.methods({ if (!user) { return; } + var priorLoginDate = user.lastLoginDate; + if (!priorLoginDate) { + priorLoginDate = new Date(); + } // Update priorLoginDate and lastLoginDate - Meteor.users.update({_id: Meteor.userId()}, {$set: {priorLoginDate: user.lastLoginDate, lastLoginDate: new Date()}}); + Meteor.users.update({_id: Meteor.userId()}, {$set: {priorLoginDate: priorLoginDate, lastLoginDate: new Date()}}); }, isAccountInactive: function (inactivityParameters) {