Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
middleware: () => next => async (action) => {
if (typeof window !== 'undefined') {
const token = cookie.get('token');
if (token) {
await cookie.set('token', token, 1);
}
}
// do something here
return next(action);
},
},