+
Skip to content

user/issues doesn't work when using OAuth #184

Closed
@rclai

Description

@rclai

Hello,

Locally I've added an additional API call on Github.User called .issues() (when authenticated via access token in OAuth) which does this:

// Authenticated via
/*
GH = new Github({
  token: validToken,
  auth: 'oauth'
});
*/
Github.User = function() {
  //...
  this.issues = function(cb) {
    _request("GET", '/user/issues', {
      filter: 'subscribed',
      state: 'all',
      sort: 'updated',
      direction: 'desc'
    }, function(err, res) {
      cb(err, res);
    }, true);
  };
  // ...
}

Based on the GitHub API documentation here, shouldn't this work?

This is the error I get back:

{
  "error": 404,
  "path": "/user/issues",
  "request": {
    "onabort": null,
    "onerror": null,
    "onload": null,
    "onloadend": null,
    "onloadstart": null,
    "onprogress": null,
    "ontimeout": null,
    "readyState": 4,
    "response": "{\n  \"message\": \"Not Found\",\n  \"documentation_url\": \"https://developer.github.com/v3\"\n}\n",
    "responseText": "{\n  \"message\": \"Not Found\",\n  \"documentation_url\": \"https://developer.github.com/v3\"\n}\n",
    "responseType": "",
    "responseURL": "https://api.github.com/user/issues?1432435698158",
    "responseXML": null,
    "status": 404,
    "statusText": "Not Found",
    "timeout": 0,
    "upload": {
      "onabort": null,
      "onerror": null,
      "onload": null,
      "onloadend": null,
      "onloadstart": null,
      "onprogress": null,
      "ontimeout": null
    },
    "withCredentials": false
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载