Привет, помогите ) не пойму почему выдает ошибку
`import { refreshToken } from './actions/auth';
export function jwt({ dispatch, getState }) {
return (next) => (action) => {
// only worry about expiring token for async actions
if (typeof action === 'function') {
// if we have token then we have tokenExpiresAt as well
if (localStorage.getItem('token')) {
if ((parseInt(localStorage.getItem('tokenExpiresAt')) -
Date.now()) < 5) {
// make sure we are not already refreshing the token
console.log(getState());
if (!getState().auth.tokenIsRefreshing) {
console.log('1');
return refreshToken(dispatch).then(() => next(action));
}
}
}
}
return next(action);
};
}`