Created
November 22, 2016 17:58
-
-
Save 0xrohan10/dcd7c33cc7f1b738b72f00d87f7b7fa5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Middleware for Drift, allowing user identification | |
| */ | |
| import { LOAD_USER_DETAILS } from '../constants/auth.constants'; | |
| const drift = window.drift ? window.drift : () => {}; | |
| const driftLogger = store => next => action => { | |
| if (action.type === LOAD_USER_DETAILS) { | |
| drift.identify( | |
| action.auth.user, | |
| { | |
| email: action.auth.email, | |
| companyId: action.auth.companyId | |
| } | |
| ); | |
| } | |
| return next(action); | |
| } | |
| export default driftLogger; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment