Skip to content

Commit

Permalink
fix(users): await user activated update
Browse files Browse the repository at this point in the history
  • Loading branch information
sw-wayner committed Jan 9, 2024
1 parent 13db2b7 commit ef3d1e5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
30 changes: 18 additions & 12 deletions lib/server/routes/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,23 +181,29 @@ UsersRouter.prototype.createUser = function (req, res, next) {

trackUserActivated(user.uuid, req.body.email);

user.save();
user.save((err) => {

/*
analytics.identify(req.headers.dnt, {
userId: user.uuid,
traits: {
activated: false
if (err) {
return next(err);
}
});
/*
analytics.identify(req.headers.dnt, {
userId: user.uuid,
traits: {
activated: false
}
});
analytics.track(req.headers.dnt, {
userId: user.uuid,
event: 'User Created'
analytics.track(req.headers.dnt, {
userId: user.uuid,
event: 'User Created'
});
*/

self._dispatchAndCreatePubKey(user, req, res, next);
});
*/

self._dispatchAndCreatePubKey(user, req, res, next);

});
}
};
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/e2e/users/users.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Bridge E2E Tests', () => {
const users = await engine.storage.models.User.find({ _id: response.body.id })
expect(users).toHaveLength(1)

// expect(users[0].toObject().activated).toBe(true)
expect(users[0].toObject().activated).toBe(true)

// expect(dispatchSendGridMock).toHaveBeenCalled()

Expand Down

0 comments on commit ef3d1e5

Please sign in to comment.