Check whether priorLoginDate is undefined
This commit is contained in:
1 parent
1a48b6040a
commit
1891d1fe75
2 files changed
+7
-1
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user