mod_http_oauth2: Specify host for which to retrieve list of roles
Fixes core/usermanager.lua:299: attempt to index a nil value (field '?')
--- a/mod_http_oauth2/mod_http_oauth2.lua Sat Mar 04 21:36:00 2023 +0100
+++ b/mod_http_oauth2/mod_http_oauth2.lua Sat Mar 04 23:36:13 2023 +0100
@@ -478,7 +478,7 @@
token_endpoint = handle_token_grant and module:http_url() .. "/token" or nil;
jwks_uri = nil; -- TODO?
registration_endpoint = handle_register_request and module:http_url() .. "/register" or nil;
- scopes_supported = usermanager.get_all_roles and array(it.keys(usermanager.get_all_roles()))
+ scopes_supported = usermanager.get_all_roles and array(it.keys(usermanager.get_all_roles(module.host)))
or { "prosody:restricted"; "prosody:user"; "prosody:admin"; "prosody:operator" };
response_types_supported = array(it.keys(response_type_handlers));
authorization_response_iss_parameter_supported = true;