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

Logout reducers #9

Open
sylvainlap opened this issue Feb 23, 2016 · 2 comments
Open

Logout reducers #9

sylvainlap opened this issue Feb 23, 2016 · 2 comments

Comments

@sylvainlap
Copy link

There are some issues with your Logout reducers:

case LOGOUT_SUCCESS:
      return Object.assign({}, state, {
        isFetching: true,
        isAuthenticated: false
      })

In case of success, isFetching shall be set to false.

Moreover, LOGOUT_REQUEST is missing.

@williamsb
Copy link

@sylvainlap In the actions file there is this function logoutUser which first dispatches requestLogout ( where isFetching=true) and then afterwards receiveLogout ( where isFetching=false).

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

However, LOGOUT_REQUEST is missing from the auth reducer. I just added it myself to my project, I'm rewriting this in typescript.

@williamsb
Copy link

also, just to add on to this, in LOGOUT_REQUEST user creds are added but never cleared.

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