{"action":"created","issue":{"url":"https://api.github.com/repos/maxmantz/redux-oidc/issues/50","repository_url":"https://api.github.com/repos/maxmantz/redux-oidc","labels_url":"https://api.github.com/repos/maxmantz/redux-oidc/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/maxmantz/redux-oidc/issues/50/comments","events_url":"https://api.github.com/repos/maxmantz/redux-oidc/issues/50/events","html_url":"https://github.com/maxmantz/redux-oidc/issues/50","id":237222294,"number":50,"title":"oidcMiddleware prevents dispatch from returning","user":{"login":"WolfspiritM","id":5904171,"avatar_url":"https://avatars1.githubusercontent.com/u/5904171?v=4","gravatar_id":"","url":"https://api.github.com/users/WolfspiritM","html_url":"https://github.com/WolfspiritM","followers_url":"https://api.github.com/users/WolfspiritM/followers","following_url":"https://api.github.com/users/WolfspiritM/following{/other_user}","gists_url":"https://api.github.com/users/WolfspiritM/gists{/gist_id}","starred_url":"https://api.github.com/users/WolfspiritM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WolfspiritM/subscriptions","organizations_url":"https://api.github.com/users/WolfspiritM/orgs","repos_url":"https://api.github.com/users/WolfspiritM/repos","events_url":"https://api.github.com/users/WolfspiritM/events{/privacy}","received_events_url":"https://api.github.com/users/WolfspiritM/received_events","type":"User","site_admin":false},"labels":[{"id":355139086,"url":"https://api.github.com/repos/maxmantz/redux-oidc/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-20T14:07:18Z","updated_at":"2018-03-27T18:50:44Z","closed_at":"2017-07-19T14:05:36Z","author_association":"NONE","body":"Hi,\r\n\r\nWhen using the oidcMiddleware in Version 3 (beta) it prevents dispatch from returning anything.\r\nIn our case we needed to get a Promise from the action but after implementing oidcMiddleware we only received undefined.\r\n\r\nLets say having following action:\r\n``` js\r\nfunction fetchAsync() {\r\n return function (getState, dispatch) {\r\n   return fetch....\r\n }\r\n}\r\n```\r\nusing dispatch(fetchAsync()).then() will result in an error as the result from dispatch will be undefined.\r\n\r\nThis is fixed when changing:\r\nhttps://github.com/maxmantz/redux-oidc/blob/master/src/oidcMiddleware.js#L46\r\nto\r\n``` js\r\n  // the middleware\r\n  return (store) => (next) => (action) => {\r\n    return co(middlewareHandler(next, action, userManager));\r\n  }\r\n```\r\n\r\nI'm however not sure if that will fix non Promise return types cause of \"co\" returning a promise instead."},"comment":{"url":"https://api.github.com/repos/maxmantz/redux-oidc/issues/comments/376634684","html_url":"https://github.com/maxmantz/redux-oidc/issues/50#issuecomment-376634684","issue_url":"https://api.github.com/repos/maxmantz/redux-oidc/issues/50","id":376634684,"user":{"login":"sulfurious","id":1566467,"avatar_url":"https://avatars0.githubusercontent.com/u/1566467?v=4","gravatar_id":"","url":"https://api.github.com/users/sulfurious","html_url":"https://github.com/sulfurious","followers_url":"https://api.github.com/users/sulfurious/followers","following_url":"https://api.github.com/users/sulfurious/following{/other_user}","gists_url":"https://api.github.com/users/sulfurious/gists{/gist_id}","starred_url":"https://api.github.com/users/sulfurious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulfurious/subscriptions","organizations_url":"https://api.github.com/users/sulfurious/orgs","repos_url":"https://api.github.com/users/sulfurious/repos","events_url":"https://api.github.com/users/sulfurious/events{/privacy}","received_events_url":"https://api.github.com/users/sulfurious/received_events","type":"User","site_admin":false},"created_at":"2018-03-27T18:50:44Z","updated_at":"2018-03-27T18:50:44Z","author_association":"NONE","body":"We started checking out redux-oidc for use in our project but are running into the issue above. We have a couple places where we are expecting a promise to be returned but instead are getting undefined.\r\n\r\nWe've fixed it by adding a return statement to return the call to middlewareHandler. Seems to make sense. Since, without it, any value returned from middlewareHandler would be stranded.\r\n\r\n```\r\n// the middleware\r\nreturn (store) => (next) => (action) => {\r\n  // added return below\r\n  return middlewareHandler(next, action, userManager);\r\n}\r\n```"}}
{"actor":{"display_login":"sulfurious"}}