# HG changeset patch # User Kim Alvefur # Date 1684407443 -7200 # Node ID 14b5446e22e1f1ac34d8b25bb2bdb6220d0b34c0 # Parent 1c78a97a1091a45fa978960f8260d70bf1f44969 mod_http_oauth2: Fix returning errors from response handlers This would either redirect the user back to the client along with the error code, or show the error HTML template. Previously this would just show some JSON to the user. diff -r 1c78a97a1091 -r 14b5446e22e1 mod_http_oauth2/mod_http_oauth2.lua --- a/mod_http_oauth2/mod_http_oauth2.lua Wed May 17 19:40:27 2023 +0200 +++ b/mod_http_oauth2/mod_http_oauth2.lua Thu May 18 12:57:23 2023 +0200 @@ -754,7 +754,11 @@ if not response_handler then return error_response(request, oauth_error("unsupported_response_type")); end - return response_handler(client, params, user_jid, id_token); + local ret = response_handler(client, params, user_jid, id_token); + if errors.is_err(ret) then + return error_response(request, ret); + end + return ret; end local function handle_revocation_request(event)