diff -r 313937349fbc -r 09d6bbd6c8a4 mod_http_oauth2/mod_http_oauth2.lua --- a/mod_http_oauth2/mod_http_oauth2.lua Thu Mar 02 11:38:57 2023 +0100 +++ b/mod_http_oauth2/mod_http_oauth2.lua Thu Mar 02 22:00:42 2023 +0100 @@ -94,7 +94,6 @@ function response_type_handlers.code(params, granted_jid) if not params.client_id then return oauth_error("invalid_request", "missing 'client_id'"); end - if not params.redirect_uri then return oauth_error("invalid_request", "missing 'redirect_uri'"); end local client_owner, client_host, client_id = jid.prepped_split(params.client_id); if client_host ~= module.host then @@ -118,7 +117,7 @@ return {status_code = 429}; end - local redirect = url.parse(params.redirect_uri); + local redirect = url.parse(params.redirect_uri or client.redirect_uri); local query = http.formdecode(redirect.query or ""); if type(query) ~= "table" then query = {}; end table.insert(query, { name = "code", value = code })