Changeset

6319:63ef69b2f046

mod_http_oauth2: Assume Prosody 13.0+ roles are available Per the README, 0.12 is not supported, so we should not need to worry about this. Plus it is assumed to be present elsewhere and that would throw errors.
author Kim Alvefur <zash@zash.se>
date Wed, 02 Jul 2025 16:15:32 +0200
parents 6318:fe797da37174
children 6320:ebcf612da2b1
files mod_http_oauth2/mod_http_oauth2.lua
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_oauth2/mod_http_oauth2.lua	Wed Jul 02 15:55:05 2025 +0200
+++ b/mod_http_oauth2/mod_http_oauth2.lua	Wed Jul 02 16:15:32 2025 +0200
@@ -1706,8 +1706,7 @@
 		token_endpoint = handle_token_grant and module:http_url() .. "/token" or nil;
 		jwks_uri = nil; -- REQUIRED in OpenID Discovery but not in OAuth 2.0 Metadata
 		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(module.host))):push("xmpp"):append(array(openid_claims:items()));
+		scopes_supported = array({ "xmpp" }):append(array(it.keys(usermanager.get_all_roles(module.host)))):append(array(openid_claims:items()));
 		response_types_supported = array(it.keys(response_type_handlers));
 		response_modes_supported = array(it.keys(response_type_handlers)):map(tmap { token = "fragment"; code = "query" });
 		grant_types_supported = array(it.keys(grant_type_handlers));