Skip to content

Commit

Permalink
add user tracking to rollbar, include mock for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
krystophv committed Oct 18, 2017
1 parent 9e0184c commit f6e4058
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"babel-plugin-rewire",
["transform-define", {
"__TEST__": "true",
"__VERSION_SHA__": "abcd",
"__DEBUG__": false
}]
]
Expand Down
9 changes: 9 additions & 0 deletions app/actions/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import _ from 'lodash';

import rollbar from '../utils/rollbar';

import * as actionTypes from '../constants/actionTypes';
import * as actionSources from '../constants/actionSources';
Expand Down Expand Up @@ -287,6 +288,14 @@ export function loginRequest() {
export function loginSuccess(results) {
const { user, profile, memberships } = results;
const isClinicAccount = personUtils.userHasRole(user, 'clinic');
rollbar.configure({
payload: {
person: {
id: user.userid,
username: user.username,
}
}
});
return {
type: actionTypes.LOGIN_SUCCESS,
payload: { user, profile, memberships },
Expand Down

0 comments on commit f6e4058

Please sign in to comment.