{"action":"created","issue":{"url":"https://api.github.com/repos/fraxedas/eloqua-oauth/issues/2","repository_url":"https://api.github.com/repos/fraxedas/eloqua-oauth","labels_url":"https://api.github.com/repos/fraxedas/eloqua-oauth/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/fraxedas/eloqua-oauth/issues/2/comments","events_url":"https://api.github.com/repos/fraxedas/eloqua-oauth/issues/2/events","html_url":"https://github.com/fraxedas/eloqua-oauth/issues/2","id":280912759,"number":2,"title":"issue on refresh token","user":{"login":"facascante","id":2068673,"avatar_url":"https://avatars3.githubusercontent.com/u/2068673?v=4","gravatar_id":"","url":"https://api.github.com/users/facascante","html_url":"https://github.com/facascante","followers_url":"https://api.github.com/users/facascante/followers","following_url":"https://api.github.com/users/facascante/following{/other_user}","gists_url":"https://api.github.com/users/facascante/gists{/gist_id}","starred_url":"https://api.github.com/users/facascante/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facascante/subscriptions","organizations_url":"https://api.github.com/users/facascante/orgs","repos_url":"https://api.github.com/users/facascante/repos","events_url":"https://api.github.com/users/facascante/events{/privacy}","received_events_url":"https://api.github.com/users/facascante/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-11T06:59:20Z","updated_at":"2017-12-12T15:14:35Z","closed_at":null,"author_association":"NONE","body":"hi,\r\n\r\ni'm using your package and it seems good but lately i notice there is a problem with the code.\r\n\r\nit still return true when there is no error and the response.statuCode >= 400\r\n\r\n```\r\noauth.request.post(options, function (error, response, body) {\r\n            if (!error && response.statusCode < 400 && body.refresh_token && body.access_token) {\r\n                next(null, body);\r\n            }else{\r\n                next(error, null);\r\n            }\r\n        });\r\n\r\n```\r\n\r\ncan you change the validation\r\n```\r\n\r\n  if (!error && response.statusCode < 400 && body.refresh_token && body.access_token) {\r\n                next(null, body);\r\n}else if(response.statusCode >= 400){\r\n                next(response, null);\r\n            }            \r\n}else{\r\n                next(error, null);\r\n            }\r\n        });\r\n\r\n```\r\n\r\nstatusCode: 400,\r\nstatusMessage: 'Bad Request',\r\n body: \r\n{ error: 'invalid_grant',\r\nerror_description: 'The refresh token is incorrect, malformed, expired, or has been invalidated.' } }"},"comment":{"url":"https://api.github.com/repos/fraxedas/eloqua-oauth/issues/comments/351080926","html_url":"https://github.com/fraxedas/eloqua-oauth/issues/2#issuecomment-351080926","issue_url":"https://api.github.com/repos/fraxedas/eloqua-oauth/issues/2","id":351080926,"user":{"login":"fraxedas","id":5787714,"avatar_url":"https://avatars2.githubusercontent.com/u/5787714?v=4","gravatar_id":"","url":"https://api.github.com/users/fraxedas","html_url":"https://github.com/fraxedas","followers_url":"https://api.github.com/users/fraxedas/followers","following_url":"https://api.github.com/users/fraxedas/following{/other_user}","gists_url":"https://api.github.com/users/fraxedas/gists{/gist_id}","starred_url":"https://api.github.com/users/fraxedas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fraxedas/subscriptions","organizations_url":"https://api.github.com/users/fraxedas/orgs","repos_url":"https://api.github.com/users/fraxedas/repos","events_url":"https://api.github.com/users/fraxedas/events{/privacy}","received_events_url":"https://api.github.com/users/fraxedas/received_events","type":"User","site_admin":false},"created_at":"2017-12-12T15:14:35Z","updated_at":"2017-12-12T15:14:35Z","author_association":"OWNER","body":"Hi @facascante,\r\nThanks for reporting the issue.\r\nCan you please send a pull request for the fix?\r\n\r\nthanks,\r\nOscar"}}
{"actor":{"display_login":"fraxedas"}}