mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 19:56:23 +00:00
[#1491] add user.loggedin on cron, some comments on remove-staging-users
This commit is contained in:
parent
cbe23f638a
commit
ecc442285b
2 changed files with 12 additions and 0 deletions
|
|
@ -4,6 +4,17 @@
|
|||
* mongo habitrpg ./migrations/20130908_remove_staged_users.js
|
||||
*/
|
||||
|
||||
/**
|
||||
* If we experience any troubles with removed staging users, come back to a snapshot and restore accounts. This will
|
||||
* give a peak into possible conflict accounts:
|
||||
*/
|
||||
/*db.users.count({
|
||||
"auth.local": {$exists: false},
|
||||
"auth.facebook": {$exists: false},
|
||||
"history.exp.5": {$exists: 1},
|
||||
$where: "this.todoIds.length != 1 && this.dailyIds.length != 3 && this.habitIds.length != 3 && this.rewardIds.length != 2"
|
||||
})*/
|
||||
|
||||
/**
|
||||
* Users used to be allowed to experiment with the site before registering. Every time a new browser visits habitrpg, a new
|
||||
* "staged" account is created - and if the user later registers, that staged account is considered a "production" account.
|
||||
|
|
|
|||
|
|
@ -489,6 +489,7 @@ api.cron = function(req, res, next) {
|
|||
algos.cron(user);
|
||||
if (user.isModified()) {
|
||||
res.locals.wasModified = true;
|
||||
user.auth.timestamps.loggedin = new Date();
|
||||
}
|
||||
user.save(next);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue