Changeset

5471:d4d333cb75b2

mod_http_oauth2: Clarify some error messages
author Kim Alvefur <zash@zash.se>
date Thu, 18 May 2023 13:24:18 +0200
parents 5470:40c990159006
children 5472:b80b6947b079
files mod_http_oauth2/mod_http_oauth2.lua
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_oauth2/mod_http_oauth2.lua	Thu May 18 13:19:25 2023 +0200
+++ b/mod_http_oauth2/mod_http_oauth2.lua	Thu May 18 13:24:18 2023 +0200
@@ -688,18 +688,20 @@
 		return error_response(request, oauth_error("invalid_request", "Invalid query parameters"));
 	end
 
-	if not params.client_id then return oauth_error("invalid_request", "missing 'client_id'"); end
+	if not params.client_id then
+		return oauth_error("invalid_request", "Missing 'client_id' parameter");
+	end
 
 	local ok, client = verify_client(params.client_id);
 
 	if not ok then
-		return oauth_error("invalid_client", "incorrect credentials");
+		return oauth_error("invalid_request", "Invalid 'client_id' parameter");
 	end
 
 	local client_response_types = set.new(array(client.response_types or { "code" }));
 	client_response_types = set.intersection(client_response_types, allowed_response_type_handlers);
 	if not client_response_types:contains(params.response_type) then
-		return oauth_error("invalid_client", "response_type not allowed");
+		return oauth_error("invalid_client", "'response_type' not allowed");
 	end
 
 	local requested_scopes = parse_scopes(params.scope or "");