mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
Some debug statements
This commit is contained in:
parent
7698e778cf
commit
61ca14a09a
1 changed files with 9 additions and 0 deletions
|
@ -71,11 +71,13 @@ then
|
||||||
|
|
||||||
-- Force portal scheme
|
-- Force portal scheme
|
||||||
if ngx.var.scheme ~= conf["portal_scheme"] then
|
if ngx.var.scheme ~= conf["portal_scheme"] then
|
||||||
|
ngx.log(ngx.DEBUG, "REDIRECT SCHEME ~= PORTAL_SCHEME: "..ngx.var.scheme)
|
||||||
return hlp.redirect(conf.portal_url)
|
return hlp.redirect(conf.portal_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add a trailing `/` if not present
|
-- Add a trailing `/` if not present
|
||||||
if ngx.var.uri.."/" == conf["portal_path"] then
|
if ngx.var.uri.."/" == conf["portal_path"] then
|
||||||
|
ngx.log(ngx.DEBUG, "REDIRECT MISSING /")
|
||||||
return hlp.redirect(conf.portal_url)
|
return hlp.redirect(conf.portal_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -98,6 +100,7 @@ then
|
||||||
if string.match(back_url, "(.*)\n") then
|
if string.match(back_url, "(.*)\n") then
|
||||||
hlp.flash("fail", hlp.t("redirection_error_invalid_url"))
|
hlp.flash("fail", hlp.t("redirection_error_invalid_url"))
|
||||||
ngx.log(ngx.ERR, "Redirection url is invalid")
|
ngx.log(ngx.ERR, "Redirection url is invalid")
|
||||||
|
ngx.log(ngx.DEBUG, "REDIRECT \\N FOUND")
|
||||||
return hlp.redirect(conf.portal_url)
|
return hlp.redirect(conf.portal_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -136,6 +139,7 @@ then
|
||||||
back_url = back_url.."sso_login="..cda_key
|
back_url = back_url.."sso_login="..cda_key
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ngx.log(ngx.DEBUG, "REDIRECT BACK URL REQUESTED")
|
||||||
return hlp.redirect(back_url)
|
return hlp.redirect(back_url)
|
||||||
|
|
||||||
|
|
||||||
|
@ -153,6 +157,7 @@ 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"))
|
||||||
|
ngx.log(ngx.DEBUG, "REDIRECT GET CATCHALL…")
|
||||||
return hlp.redirect(conf.portal_url)
|
return hlp.redirect(conf.portal_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -173,6 +178,7 @@ then
|
||||||
else
|
else
|
||||||
-- Redirect to portal
|
-- Redirect to portal
|
||||||
hlp.flash("fail", hlp.t("please_login_from_portal"))
|
hlp.flash("fail", hlp.t("please_login_from_portal"))
|
||||||
|
ngx.log(ngx.DEBUG, "REDIRECT POST CATCHALL…")
|
||||||
return hlp.redirect(conf.portal_url)
|
return hlp.redirect(conf.portal_url)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -303,6 +309,7 @@ if hlp.is_logged_in() then
|
||||||
|
|
||||||
-- If user has no access to this URL, redirect him to the portal
|
-- If user has no access to this URL, redirect him to the portal
|
||||||
if not hlp.has_access() then
|
if not hlp.has_access() then
|
||||||
|
ngx.log(ngx.DEBUG, "REDIRECT ACCESS DENIED")
|
||||||
return hlp.redirect(conf.portal_url)
|
return hlp.redirect(conf.portal_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -376,6 +383,7 @@ if auth_header then
|
||||||
|
|
||||||
-- If user has no access to this URL, redirect him to the portal
|
-- If user has no access to this URL, redirect him to the portal
|
||||||
if not hlp.has_access(user) then
|
if not hlp.has_access(user) then
|
||||||
|
ngx.log(ngx.DEBUG, "REDIRECT BASIC AUTH OK")
|
||||||
return hlp.redirect(conf.portal_url)
|
return hlp.redirect(conf.portal_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -393,4 +401,5 @@ end
|
||||||
|
|
||||||
hlp.flash("info", hlp.t("please_login"))
|
hlp.flash("info", hlp.t("please_login"))
|
||||||
local back_url = ngx.var.scheme .. "://" .. ngx.var.host .. ngx.var.uri .. hlp.uri_args_string()
|
local back_url = ngx.var.scheme .. "://" .. ngx.var.host .. ngx.var.uri .. hlp.uri_args_string()
|
||||||
|
ngx.log(ngx.DEBUG, "REDIRECT BY DEFAULT")
|
||||||
return hlp.redirect(conf.portal_url.."?r="..ngx.encode_base64(back_url))
|
return hlp.redirect(conf.portal_url.."?r="..ngx.encode_base64(back_url))
|
||||||
|
|
Loading…
Add table
Reference in a new issue