summaryrefslogtreecommitdiff
path: root/lib/web
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/web/auth/saml/index.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/web/auth/saml/index.js b/lib/web/auth/saml/index.js
index 40a6f8b3..1c80c934 100644
--- a/lib/web/auth/saml/index.js
+++ b/lib/web/auth/saml/index.js
@@ -7,6 +7,7 @@ const config = require('../../../config')
const models = require('../../../models')
const logger = require('../../../logger')
const { urlencodedParser } = require('../../utils')
+const { setReturnToFromReferer } = require('../utils')
const fs = require('fs')
const intersection = function (array1, array2) { return array1.filter((n) => array2.includes(n)) }
@@ -76,11 +77,13 @@ passport.use(new SamlStrategy({
})
}))
-samlAuth.get('/auth/saml',
+samlAuth.get('/auth/saml',function(req,res,next) {
+ setReturnToFromReferer(req)
passport.authenticate('saml', {
successReturnToOrRedirect: config.serverURL + '/',
failureRedirect: config.serverURL + '/'
- })
+ })(req,res,next)
+ }
)
samlAuth.post('/auth/saml/callback', urlencodedParser,