Skip to content

Commit

Permalink
Merge pull request #780 from mcneilco/754-sso-saml-support
Browse files Browse the repository at this point in the history
Fixing redirect to client.baseBath
  • Loading branch information
brianbolt committed Jul 13, 2021
2 parents d7f83a1 + be399ea commit 0e71549
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/Login/src/server/routes/loginRoutes.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,12 @@ exports.ensureAuthenticated = (req, res, next) ->
return next()
if req.session?
req.session.returnTo = req.url
redirectURL = req.protocol + '://' + req.get('host') + req.originalUrl

basePath = req.protocol + '://' + req.get('host')
if req.originalUrl == "/" && config.all.client.basePath?
redirectURL = "#{basePath}#{config.all.client.basePath}"
else
redirectURL = "#{basePath}#{req.originalURL}"
res.redirect '/login?redirect_url='+redirectURL

exports.ensureAuthenticatedAPI = (req, res, next) ->
Expand Down

0 comments on commit 0e71549

Please sign in to comment.