feat(analytics): initial Habitica-owned solution

This commit is contained in:
Phillip Thelen
2026-04-07 15:33:57 -05:00
committed by Kalista Payne
parent 746fcfff49
commit e6ffd69148
90 changed files with 762 additions and 2479 deletions
@@ -1,6 +1,5 @@
import validator from 'validator';
import moment from 'moment';
import pick from 'lodash/pick';
import sortBy from 'lodash/sortBy';
import nconf from 'nconf';
import {
@@ -127,14 +126,6 @@ api.loginLocal = {
user.auth.timestamps.updated = new Date();
await user.save();
res.analytics.track('login', {
user: pick(user, ['preferences', 'registeredThrough']),
category: 'behavior',
type: 'local',
uuid: user._id,
headers: req.headers,
});
return loginRes(user, req, res);
},
};