moul / node-gitlab

DEPRECATED, see https://github.com/node-gitlab/node-gitlab
https://npmjs.org/package/gitlab
Other
470 stars 140 forks source link

Problem to fetch current user #161

Closed joliejuke-orga closed 5 years ago

joliejuke-orga commented 7 years ago

Here is my code:

var Gitlab = require('gitlab');

function __auth() {

    return Gitlab({
        url: 'https://gitlab.com',
        token: '123mytoken'
    });
}

function getUser() {

    var gitlab = __auth();
    gitlab.users.current(function(doc) {
        console.log(doc) ---> null
    });

}

I don't understand what is missing. Do you have a full documentation ressource of the module? Promises are supported?

I'm waiting like 5s before to get the response, maybe the URL is not the good one to request from gitlab provider.

Best.