mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
Prevent epic crash when domain_portal_urls or permissions are not defined in the conf
This commit is contained in:
parent
769f5f9cfa
commit
a3d54635e0
1 changed files with 9 additions and 0 deletions
|
@ -87,6 +87,15 @@ function get_config()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Define empty dict if conf file is empty~ish,
|
||||||
|
-- to at least avoid miserably crashing later
|
||||||
|
if conf["domain_portal_urls"] == nil then
|
||||||
|
conf["domain_portal_urls"] = {}
|
||||||
|
end
|
||||||
|
if conf["permissions"] == nil then
|
||||||
|
conf["permissions"] = {}
|
||||||
|
end
|
||||||
|
|
||||||
-- Always skip the portal urls to avoid redirection looping.
|
-- Always skip the portal urls to avoid redirection looping.
|
||||||
for domain, portal_url in pairs(conf["domain_portal_urls"]) do
|
for domain, portal_url in pairs(conf["domain_portal_urls"]) do
|
||||||
table.insert(conf["permissions"]["core_skipped"]["uris"], portal_url)
|
table.insert(conf["permissions"]["core_skipped"]["uris"], portal_url)
|
||||||
|
|
Loading…
Add table
Reference in a new issue