summaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'app.js')
-rw-r--r--app.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/app.js b/app.js
index 964a3a81..60eb61b5 100644
--- a/app.js
+++ b/app.js
@@ -448,10 +448,20 @@ app.get('/gitlab', function (req, res) {
models.User.findById(req.cookies.userid)
.then(function(user) {
ret.accesstoken = user.accessToken;
- return res.send(ret);
+ request(
+ config.gitlab.baseURL + '/api/v3/projects?access_token=' + user.accessToken,
+ function(error, httpResponse, body) {
+ if (!error && httpResponse.statusCode == 200) {
+ ret.projects = JSON.parse(body);
+ return res.send(ret);
+ } else {
+ return res.send(ret);
+ }
+ }
+ );
}).catch(function(err) {
logger.error('user search failed: ' + err);
- return done(err, null);
+ return response.errorInternalError(res);
});
});
//get new note