{"action":"created","issue":{"url":"https://api.github.com/repos/rackt/react-router/issues/590","labels_url":"https://api.github.com/repos/rackt/react-router/issues/590/labels{/name}","comments_url":"https://api.github.com/repos/rackt/react-router/issues/590/comments","events_url":"https://api.github.com/repos/rackt/react-router/issues/590/events","html_url":"https://github.com/rackt/react-router/pull/590","id":51653037,"number":590,"title":"Allow transition hooks access to a context object you can specify when you create the router.","user":{"login":"bobpace","id":131044,"avatar_url":"https://avatars.githubusercontent.com/u/131044?v=3","gravatar_id":"","url":"https://api.github.com/users/bobpace","html_url":"https://github.com/bobpace","followers_url":"https://api.github.com/users/bobpace/followers","following_url":"https://api.github.com/users/bobpace/following{/other_user}","gists_url":"https://api.github.com/users/bobpace/gists{/gist_id}","starred_url":"https://api.github.com/users/bobpace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobpace/subscriptions","organizations_url":"https://api.github.com/users/bobpace/orgs","repos_url":"https://api.github.com/users/bobpace/repos","events_url":"https://api.github.com/users/bobpace/events{/privacy}","received_events_url":"https://api.github.com/users/bobpace/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":94,"created_at":"2014-12-11T06:49:52Z","updated_at":"2015-07-19T22:53:51Z","closed_at":"2015-06-15T03:28:33Z","pull_request":{"url":"https://api.github.com/repos/rackt/react-router/pulls/590","html_url":"https://github.com/rackt/react-router/pull/590","diff_url":"https://github.com/rackt/react-router/pull/590.diff","patch_url":"https://github.com/rackt/react-router/pull/590.patch"},"body":"I've been trying to make an authentication mixin that can access the state in one of my flux stores but am not using singletons that I can make available to the static methods. Would it be alright to pass a context object through to the static willTransition hook methods to allow them access to arbitrary services you might need?\r\n\r\n        var context = {...}\r\n        Router.create({routes: routes, transitionContext: context})\r\n\r\n        statics: {\r\n          willTransitionTo: function(transition) {\r\n             var loginState = transition.context.getStore(LoginStore).getState();\r\n          }\r\n        }\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rackt/react-router/issues/comments/122713270","html_url":"https://github.com/rackt/react-router/pull/590#issuecomment-122713270","issue_url":"https://api.github.com/repos/rackt/react-router/issues/590","id":122713270,"user":{"login":"terranmoccasin","id":416781,"avatar_url":"https://avatars.githubusercontent.com/u/416781?v=3","gravatar_id":"","url":"https://api.github.com/users/terranmoccasin","html_url":"https://github.com/terranmoccasin","followers_url":"https://api.github.com/users/terranmoccasin/followers","following_url":"https://api.github.com/users/terranmoccasin/following{/other_user}","gists_url":"https://api.github.com/users/terranmoccasin/gists{/gist_id}","starred_url":"https://api.github.com/users/terranmoccasin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terranmoccasin/subscriptions","organizations_url":"https://api.github.com/users/terranmoccasin/orgs","repos_url":"https://api.github.com/users/terranmoccasin/repos","events_url":"https://api.github.com/users/terranmoccasin/events{/privacy}","received_events_url":"https://api.github.com/users/terranmoccasin/received_events","type":"User","site_admin":false},"created_at":"2015-07-19T22:53:51Z","updated_at":"2015-07-19T22:53:51Z","body":"@bman654 Ah okay, I was hoping there was a more elegant solution for using localStorage instead of cookies. For localStorage, what you're saying is that since you cant send an HTTP header on just a regular browser GET request when the user first loads the page, you need to have some AJAX call that happens after the page loads to authenticate to the server-side, and THEN render the root react app and pass it along to the client?"}}