Clear state upon logging out. #144
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
KittenSquad/glewlwyd!144
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "clear-state"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@babelouest I'm submitting this PR tentatively—feel free to close, delete, or continue the discussion via a private channel.
A proper log-out view is in the works, as we both know, and this will eliminate once and for all the possibility of private data remaining visible on the screen after logging out.
From a security point of view, though, hiding things from view is likely not enough. An intuitively and formally trustworthy pattern for deleting all potentially private data from
this.statewould provide additional piece of mind. I think a Redux developer (which I'm not) would use "reducers" for doing this reliably.In a typical React pattern, where statefulness is tightly controlled, this is not difficult to do. Yet state ownership in Glewlwyd is distributed among components. So each component should probably provide reasonable "proof" that it has cleaned after itself whenever a user logs out. I realize that this is mostly done already—mostly, but not always, and sometimes it is hard to tell (e.g. with schemes/plugins).
The PR is meant to raise the issue. It proposes that
componentWillReceiveProps()might (?) be a suitable place for zeroing-out state values in an accountable way ("accountable" in the sense that any state values not reset withincomponentWillReceivePropsmay not be safely assumed reset upon logging out).In the longer run, one would probably take measures against browser caching and "forward-backward" browser navigation, e.g. by using React Router.
Thanks @yrammos for the pull request, although as I told you, I already started some work in the logout-screen branch, I'd like to concentrate the logging out work on this branch if you don't mind, it'll be easier.
Sure enough, @babelouest, this is meant as a bookmark for future discussion. Feel free to close as you see fit. Will look at your log out branch shortly.
@yrammos , if possible, backport this pull request in the new branch if you like
@babelouest, back-ported as #145.
Pull request closed