Merge pull request #132 from eauchat/theming-reloaded-redirections

Theming reloaded redirections improved
This commit is contained in:
Alexandre Aubin 2019-03-23 14:53:22 +01:00 committed by GitHub
commit 4c2a9da784
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -162,7 +162,12 @@ then
-- If all the previous cases have failed, redirect to portal -- If all the previous cases have failed, redirect to portal
else else
hlp.flash("info", hlp.t("please_login")) hlp.flash("info", hlp.t("please_login"))
return hlp.redirect(conf.portal_url) -- Force the scheme to HTTPS. This is to avoid an issue with redirection loop
-- when trying to access http://main.domain.tld/ (SSOwat finds that user aint
-- logged in, therefore redirects to SSO, which redirects to the back_url, which
-- redirect to SSO, ..)
local back_url = "https://" .. ngx.var.host .. ngx.var.uri .. hlp.uri_args_string()
return hlp.redirect(conf.portal_url.."?r="..ngx.encode_base64(back_url))
end end