Code Monkey home page Code Monkey logo

Comments (8)

tansaku avatar tansaku commented on May 19, 2024

just following up I switched to oauth, and tried just showing a user

user.show('mtc2013', function(err, user) {});

I get "Uncaught TypeError: undefined is not a function" on line 32 of gtihub.js

from github.

mikemorris avatar mikemorris commented on May 19, 2024

@tansaku duplicate of #49?

from github.

tansaku avatar tansaku commented on May 19, 2024

I did see that and I tried switching to var xhr = new window.XMLHttpRequest() and the error goes away, but now I just get undefined:

var user = github.getUser();
var gist = github.getGist(5534034);
user.show('mtc2013', function(err, user) {
  alert(user);
});
gist.read(function(err, gist) {
  alert(gist);
});

the pop ups just say undefined ... :-(

from github.

tansaku avatar tansaku commented on May 19, 2024

ah, I had them wrapped in a jquery $(function() {} have moved them out and now it's working - sorry to have bothered you. BTW, I would love to know if I can support that "authorise with github" button with just github.js or if I need to pull stuff in from prose.io. Github.js seems to be designed to work with a hardcoded particular user - I'd really like users of my system to be able to authenticate against their own accounts rather than using mine ...

from github.

holsted avatar holsted commented on May 19, 2024

@tansaku, You will probably need more than just github.js. Do you have your own application set up on GitHub to authenticate with the GitHub API? You may want to take a look at GateKeeper (written for prose.io, I think). I'm using it with a combination of github.js and some custom code to let users authorize with their GitHub accounts for a chrome extension. You can checkout my blog post for more details.

from github.

mattpass avatar mattpass commented on May 19, 2024

You can authenticate with github.js using basic auth (username & password combos, easy to use but insecure really) or auth tokens - either Authorised App Tokens (based on client/secrets) or Personal Access Tokens (set up using the web UI).

More info on creating a token here:
https://help.github.com/articles/creating-an-access-token-for-command-line-use
and creating them during web app flow/on the fly here:
http://developer.github.com/v3/oauth/

Hope that helps.

from github.

michael avatar michael commented on May 19, 2024

In order to use OAuth, you probably want to integrate this little server piece.

https://github.com/prose/gatekeeper

from github.

michael avatar michael commented on May 19, 2024

Oh this was already mentioned... anyways.

from github.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.