Handle social auth in A/B testing (#8024)

* fix(AB-testing): handle social auth

* refactor(AB-testing): move to pre save hooks
This commit is contained in:
Sabe Jones
2016-09-16 12:13:21 -05:00
committed by Matteo Pagliazzi
parent 81b7eeeb71
commit 86c9bddc09
3 changed files with 20 additions and 10 deletions

View File

@@ -130,14 +130,6 @@ api.registerLocal = {
newUser.registeredThrough = req.headers['x-client']; // Not saved, used to create the correct tasks based on the device used
}
// A/B Test 2016-09-12: Start with Sound Enabled?
if (Math.random() < 0.5) {
newUser.preferences.sound = 'rosstavoTheme';
newUser._ABtest = '20160912-soundEnabled';
} else {
newUser._ABtest = '20160912-soundDisabled';
}
// we check for partyInvite for backward compatibility
if (req.query.groupInvite || req.query.partyInvite) {
await _handleGroupInvitation(newUser, req.query.groupInvite || req.query.partyInvite);