mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-01-27 14:01:22 +00:00
Fixing redirection after SAML login
Saving referer into session in SAML auth so passport can redirect correctly after SAML login. Signed-off-by: Ralph Krimmel <rkrimme1@gwdg.de>
This commit is contained in:
parent
689f5a0a95
commit
1881775379
1 changed files with 5 additions and 2 deletions
|
@ -7,6 +7,7 @@ const config = require('../../../config')
|
||||||
const models = require('../../../models')
|
const models = require('../../../models')
|
||||||
const logger = require('../../../logger')
|
const logger = require('../../../logger')
|
||||||
const { urlencodedParser } = require('../../utils')
|
const { urlencodedParser } = require('../../utils')
|
||||||
|
const { setReturnToFromReferer } = require('../utils')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const intersection = function (array1, array2) { return array1.filter((n) => array2.includes(n)) }
|
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', {
|
passport.authenticate('saml', {
|
||||||
successReturnToOrRedirect: config.serverURL + '/',
|
successReturnToOrRedirect: config.serverURL + '/',
|
||||||
failureRedirect: config.serverURL + '/'
|
failureRedirect: config.serverURL + '/'
|
||||||
})
|
})(req,res,next)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
samlAuth.post('/auth/saml/callback', urlencodedParser,
|
samlAuth.post('/auth/saml/callback', urlencodedParser,
|
||||||
|
|
Loading…
Reference in a new issue