Mercurial > prosody-modules
diff mod_http_oauth2/mod_http_oauth2.lua @ 5205:b6f41f0b5f58
mod_http_oauth2: Specify host for which to retrieve list of roles
Fixes core/usermanager.lua:299: attempt to index a nil value (field '?')
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 04 Mar 2023 23:36:13 +0100 |
parents | eb8b3a068ecc |
children | 31c62df82aa8 |
line wrap: on
line diff
--- 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;