mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
Fix ynhpanel.js access in unprotected case
This commit is contained in:
parent
cb6a827157
commit
e979eb4f65
1 changed files with 10 additions and 0 deletions
10
access.lua
10
access.lua
|
@ -348,6 +348,11 @@ if conf["unprotected_urls"] then
|
|||
and not is_protected() then
|
||||
if hlp.is_logged_in() then
|
||||
hlp.set_headers()
|
||||
elseif string.match(ngx.var.uri, "^/ynhpanel.js$")
|
||||
or string.match(ngx.var.uri, "^/ynhpanel.css$")
|
||||
or string.match(ngx.var.uri, "^/ynhpanel.json$") then
|
||||
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
|
||||
return hlp.pass()
|
||||
end
|
||||
|
@ -361,6 +366,11 @@ if conf["unprotected_regex"] then
|
|||
and not is_protected() then
|
||||
if hlp.is_logged_in() then
|
||||
hlp.set_headers()
|
||||
elseif string.match(ngx.var.uri, "^/ynhpanel.js$")
|
||||
or string.match(ngx.var.uri, "^/ynhpanel.css$")
|
||||
or string.match(ngx.var.uri, "^/ynhpanel.json$") then
|
||||
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
|
||||
return hlp.pass()
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue