summaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'app.js')
-rw-r--r--app.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/app.js b/app.js
index f096ab64..a17d3a61 100644
--- a/app.js
+++ b/app.js
@@ -381,6 +381,18 @@ if (config.google) {
failureRedirect: config.serverurl + '/'
}));
}
+// ldap auth
+if (config.ldap) {
+ app.post('/auth/ldap', urlencodedParser, function (req, res, next) {
+ if (!req.body.username || !req.body.password) return response.errorBadRequest(res);
+ setReturnToFromReferer(req);
+ passport.authenticate('ldapauth', {
+ successReturnToOrRedirect: config.serverurl + '/',
+ failureRedirect: config.serverurl + '/',
+ failureFlash: true
+ })(req, res, next);
+ });
+}
// email auth
if (config.email) {
app.post('/register', urlencodedParser, function (req, res, next) {