{"action":"opened","issue":{"url":"https://api.github.com/repos/reactjs/react-router/issues/3273","repository_url":"https://api.github.com/repos/reactjs/react-router","labels_url":"https://api.github.com/repos/reactjs/react-router/issues/3273/labels{/name}","comments_url":"https://api.github.com/repos/reactjs/react-router/issues/3273/comments","events_url":"https://api.github.com/repos/reactjs/react-router/issues/3273/events","html_url":"https://github.com/reactjs/react-router/issues/3273","id":147289449,"number":3273,"title":"replace does not work work inside async function","user":{"login":"littlee","id":7534668,"avatar_url":"https://avatars.githubusercontent.com/u/7534668?v=3","gravatar_id":"","url":"https://api.github.com/users/littlee","html_url":"https://github.com/littlee","followers_url":"https://api.github.com/users/littlee/followers","following_url":"https://api.github.com/users/littlee/following{/other_user}","gists_url":"https://api.github.com/users/littlee/gists{/gist_id}","starred_url":"https://api.github.com/users/littlee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/littlee/subscriptions","organizations_url":"https://api.github.com/users/littlee/orgs","repos_url":"https://api.github.com/users/littlee/repos","events_url":"https://api.github.com/users/littlee/events{/privacy}","received_events_url":"https://api.github.com/users/littlee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-11T01:29:00Z","updated_at":"2016-04-11T01:29:00Z","closed_at":null,"body":"I am following this example code to implement my own auth-flow\r\nhttps://github.com/reactjs/react-router/blob/master/examples/auth-flow/app.js#L120-L127\r\n\r\nbecause my authentication strategy is session based, so I make it async:\r\n```\r\nvar request = require('superagent');\r\nfunction requireAuth(nextState, replace) {\r\n\trequest\r\n\t\t.get('/user/isUserLoggedIn')\r\n\t\t.end(function(err, res) {\r\n\t\t\talert(res.body.loggedIn); // false\r\n\t\t\tif (!res.body.loggedIn) {\r\n\t\t\t\treplace({\r\n\t\t\t\t\tpathname: '/login',\r\n\t\t\t\t\tstate: {\r\n\t\t\t\t\t\tnextPathname: nextState.location.pathname\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t})\r\n}\r\n```\r\nit did alert, but it never redirect to `/login`, even if I make `/user/isLoggedIn` directly return \r\n```\r\n{loggedIn: false}\r\n```\r\n\r\n"}}