Skip to content

Clear redux store state on user logout

Alf Eaton requested to merge clear-store-on-logout into master

As reported by @yannisbarlas in https://gitlab.coko.foundation/pubsweet/pubsweet-components/issues/16#note_1264, the redux store should be cleared when the user logs out, to avoid exposing the data to other users.

Each reducer handles its own reset on LOGOUT_SUCCESS, as resetting the whole store causes problems for other components which store data there, such as react-router-redux.

This makes pubsweet-component-login a full dependency of pubsweet-client, but given that it's already a dependency of the tests I think that's ok. The alternative would be to just use 'LOGOUT_SUCCESS' as a string, instead of the constant.

Merge request reports