# HG changeset patch # User Kim Alvefur # Date 1677969373 -3600 # Node ID b6f41f0b5f58b70b6bf13cad24b639435dcc66ae # Parent eb8b3a068ecc865e282fd98db2dbed4c618b591b mod_http_oauth2: Specify host for which to retrieve list of roles Fixes core/usermanager.lua:299: attempt to index a nil value (field '?') diff -r eb8b3a068ecc -r b6f41f0b5f58 mod_http_oauth2/mod_http_oauth2.lua --- 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;