Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught Error: Actions must be plain objects. Use custom middleware for async actions. #17

Open
williamgranli opened this issue Oct 14, 2016 · 2 comments

Comments

@williamgranli
Copy link

I'm getting this error in the below action:

// Logs the user out
export function logoutUser() {
  return dispatch => {
    localStorage.removeItem('id_token')
    dispatch(requestLogout())
    dispatch(receiveLogout())
  }
}

Anyone know why?

@camel113
Copy link

@williamgranli Did you find why?

@williamgranli
Copy link
Author

williamgranli commented Nov 21, 2016

@camel113 I didn't. I can subjectively say that this example seems sub-par compared to using https://github.com/mjrussell/redux-auth-wrapper to protect routes and https://github.com/sotojuan/saga-login-flow for the actual logic. That's what I ended up using anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants