mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 17:28:54 +00:00
17 lines
441 B
JavaScript
17 lines
441 B
JavaScript
|
/* eslint-disable no-unused-vars */
|
||
|
import kolide from '../../kolide';
|
||
|
import { LOGIN_SUCCESS } from '../nodes/auth/actions';
|
||
|
import local from '../../utilities/local';
|
||
|
|
||
|
const authMiddleware = store => next => action => {
|
||
|
if (action.type === LOGIN_SUCCESS) {
|
||
|
const { token } = action.payload.data;
|
||
|
local.setItem('auth_token', token);
|
||
|
kolide.setBearerToken(token);
|
||
|
}
|
||
|
|
||
|
return next(action);
|
||
|
};
|
||
|
|
||
|
export default authMiddleware;
|