Check whether priorLoginDate is undefined
This commit is contained in:
parent
1a48b6040a
commit
1891d1fe75
@ -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);
|
||||
});
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user