{"action":"closed","issue":{"url":"https://api.github.com/repos/mjrussell/redux-auth-wrapper/issues/10","repository_url":"https://api.github.com/repos/mjrussell/redux-auth-wrapper","labels_url":"https://api.github.com/repos/mjrussell/redux-auth-wrapper/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/mjrussell/redux-auth-wrapper/issues/10/comments","events_url":"https://api.github.com/repos/mjrussell/redux-auth-wrapper/issues/10/events","html_url":"https://github.com/mjrussell/redux-auth-wrapper/issues/10","id":127519739,"number":10,"title":"Include example/suggestions for local storage","user":{"login":"mjrussell","id":1641895,"avatar_url":"https://avatars.githubusercontent.com/u/1641895?v=3","gravatar_id":"","url":"https://api.github.com/users/mjrussell","html_url":"https://github.com/mjrussell","followers_url":"https://api.github.com/users/mjrussell/followers","following_url":"https://api.github.com/users/mjrussell/following{/other_user}","gists_url":"https://api.github.com/users/mjrussell/gists{/gist_id}","starred_url":"https://api.github.com/users/mjrussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjrussell/subscriptions","organizations_url":"https://api.github.com/users/mjrussell/orgs","repos_url":"https://api.github.com/users/mjrussell/repos","events_url":"https://api.github.com/users/mjrussell/events{/privacy}","received_events_url":"https://api.github.com/users/mjrussell/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mjrussell/redux-auth-wrapper/labels/examples","name":"examples","color":"fad8c7"},{"url":"https://api.github.com/repos/mjrussell/redux-auth-wrapper/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-01-19T19:29:57Z","updated_at":"2016-05-16T15:11:11Z","closed_at":"2016-05-16T15:11:11Z","body":"Currently there isn't a great way to use local storage.\r\n\r\nThe best solution right now is to have a call similar to \"what user am I?\" maybe like a `/api/users/me` or similar. This will set the userAuthData in the store if successful and be dispatched on application load. On a 401, you clear this data out of the store. \r\n\r\nThis way your app doesn't even know about a cookie in localstorage, it just knows if there is a user or not. When you login successfully, you can dispatch the `getUser` using something like `redux-thunk`.\r\n\r\nShould document this better or provide an alternative way.\r\n\r\nOne such alternative could be to provide a \"isLoggingIn\" selector which will display a component of the user's choice while this value is true instead of performing a redirect or showing the authed component"}}