{"action":"closed","issue":{"url":"https://api.github.com/repos/ReactTraining/react-router/issues/3932","repository_url":"https://api.github.com/repos/ReactTraining/react-router","labels_url":"https://api.github.com/repos/ReactTraining/react-router/issues/3932/labels{/name}","comments_url":"https://api.github.com/repos/ReactTraining/react-router/issues/3932/comments","events_url":"https://api.github.com/repos/ReactTraining/react-router/issues/3932/events","html_url":"https://github.com/ReactTraining/react-router/issues/3932","id":178741192,"number":3932,"title":"Feature Request: Mechanism for \"guarding\" routes","user":{"login":"nibblesnbits","id":6042917,"avatar_url":"https://avatars.githubusercontent.com/u/6042917?v=3","gravatar_id":"","url":"https://api.github.com/users/nibblesnbits","html_url":"https://github.com/nibblesnbits","followers_url":"https://api.github.com/users/nibblesnbits/followers","following_url":"https://api.github.com/users/nibblesnbits/following{/other_user}","gists_url":"https://api.github.com/users/nibblesnbits/gists{/gist_id}","starred_url":"https://api.github.com/users/nibblesnbits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nibblesnbits/subscriptions","organizations_url":"https://api.github.com/users/nibblesnbits/orgs","repos_url":"https://api.github.com/users/nibblesnbits/repos","events_url":"https://api.github.com/users/nibblesnbits/events{/privacy}","received_events_url":"https://api.github.com/users/nibblesnbits/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-22T22:54:13Z","updated_at":"2016-09-23T01:23:11Z","closed_at":"2016-09-23T01:23:11Z","body":"I have an application which needs to prevent access to certain routes (e.g., a Profile page).  I have found that the `onEnter` method does allow me to kick a user back to another route if necessary, but my main problem with it is that the method is static, and also provides no insight into the application state.  I *could* simply check my cookie/localStorage/etc from this static method, but that hardly feels ideal.  Would it be possible to provide access to the store or possibly the component's `props` within the onEnter handler?  Obviously this may require moving the onEnter handler to be an instance method, but I feel like that would provide a lot of power that currently isn't possible."}}
{"actor":{"display_login":"timdorr"}}