Add config option for gitlab api scope and auto adapt gitlab snippet feature on it

This commit is contained in:
Wu Cheng-Han 2017-03-14 18:04:23 +08:00
parent baf13072c1
commit 506a381eca
7 changed files with 19 additions and 9 deletions

6
app.js
View file

@ -335,8 +335,10 @@ if (config.github) {
successReturnToOrRedirect: config.serverurl + '/',
failureRedirect: config.serverurl + '/'
}))
// github callback actions
app.get('/auth/github/callback/:noteId/:action', response.githubActions)
if (!config.gitlab.scope || config.gitlab.scope === 'api') {
// gitlab callback actions
app.get('/auth/gitlab/callback/:noteId/:action', response.gitlabActions)
}
}
// gitlab auth
if (config.gitlab) {