diff --git a/migrations/20130908_remove_staged_users.js b/migrations/20130908_remove_staged_users.js index 8cca99bf24..7bf75c0096 100644 --- a/migrations/20130908_remove_staged_users.js +++ b/migrations/20130908_remove_staged_users.js @@ -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. diff --git a/src/controllers/user.js b/src/controllers/user.js index db0b3e3517..b9d494fb54 100644 --- a/src/controllers/user.js +++ b/src/controllers/user.js @@ -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); };