mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
allow to redirect sso pages the same way than apps urls (from login page)
This commit is contained in:
parent
4da84b0e30
commit
13257e4de0
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue