give a user a brownie point when they start

This commit is contained in:
Quincy Larson
2015-08-10 20:55:01 -07:00
parent 44cf78afab
commit 7bfe61731b
3 changed files with 39 additions and 35 deletions

View File

@ -51,6 +51,14 @@ module.exports = function(User) {
user.email = typeof user.email === 'string' ?
user.email.trim().toLowerCase() :
user.email;
if (!user.progressTimestamps) {
user.progressTimestamps = [];
}
if (user.progressTimestamps.length === 0) {
user.progressTimestamps.push({ timestamp: Date.now() });
}
}
next();
});