Changeset

10634:c9e1cb7a38b8

usermanager: Load authz providers on components also
author Matthew Wild <mwild1@gmail.com>
date Mon, 27 Jan 2020 22:09:19 +0000
parents 10633:d1cc6af0fb97
children 10635:675d9fbcbaed
files core/usermanager.lua
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/core/usermanager.lua	Mon Jan 27 21:54:59 2020 +0000
+++ b/core/usermanager.lua	Mon Jan 27 22:09:19 2020 +0000
@@ -55,6 +55,12 @@
 
 local function initialize_host(host)
 	local host_session = hosts[host];
+
+	local authz_provider_name = config.get(host, "authorization") or "internal";
+
+	local authz_mod = modulemanager.load(host, "authz_"..authz_provider_name);
+	host_session.authz = authz_mod or global_authz_provider;
+
 	if host_session.type ~= "local" then return; end
 
 	host_session.events.add_handler("item-added/auth-provider", function (event)
@@ -84,10 +90,6 @@
 		modulemanager.load(host, "auth_"..auth_provider);
 	end
 
-	local authz_provider_name = config.get(host, "authorization") or "internal";
-
-	local authz_mod = modulemanager.load(host, "authz_"..authz_provider_name);
-	host_session.authz = authz_mod or global_authz_provider;
 end;
 prosody.events.add_handler("host-activated", initialize_host, 100);