comparison mod_http_oauth2/mod_http_oauth2.lua @ 5469:03f393d572fe

mod_http_oauth2: Add human-readable error messages
author Kim Alvefur <zash@zash.se>
date Thu, 18 May 2023 13:03:09 +0200
parents 14b5446e22e1
children 40c990159006
comparison
equal deleted inserted replaced
5468:14b5446e22e1 5469:03f393d572fe
679 679
680 local function handle_authorization_request(event) 680 local function handle_authorization_request(event)
681 local request = event.request; 681 local request = event.request;
682 682
683 if not request.url.query then 683 if not request.url.query then
684 return error_response(request, oauth_error("invalid_request")); 684 return error_response(request, oauth_error("invalid_request", "Missing query parameters"));
685 end 685 end
686 local params = http.formdecode(request.url.query); 686 local params = http.formdecode(request.url.query);
687 if not params then 687 if not params then
688 return error_response(request, oauth_error("invalid_request")); 688 return error_response(request, oauth_error("invalid_request", "Invalid query parameters"));
689 end 689 end
690 690
691 if not params.client_id then return oauth_error("invalid_request", "missing 'client_id'"); end 691 if not params.client_id then return oauth_error("invalid_request", "missing 'client_id'"); end
692 692
693 local ok, client = verify_client(params.client_id); 693 local ok, client = verify_client(params.client_id);