mod_http_oauth2: Return proper OAuth error for invalid redirect URI
authorKim Alvefur <zash@zash.se>
Wed, 17 May 2023 16:34:19 +0200
changeset 5466 f6d8830a83fe
parent 5465 06640647d193
child 5467 dacde53467f3
mod_http_oauth2: Return proper OAuth error for invalid redirect URI An unspecific status code of 400 isn't very helpful, this should at least provide a hint as to what is wrong.
mod_http_oauth2/mod_http_oauth2.lua
--- a/mod_http_oauth2/mod_http_oauth2.lua	Wed May 17 13:51:30 2023 +0200
+++ b/mod_http_oauth2/mod_http_oauth2.lua	Wed May 17 16:34:19 2023 +0200
@@ -337,7 +337,7 @@
 		}) or ("Here's your authorization code:\n%s\n"):format(code);
 		return response;
 	elseif not redirect_uri then
-		return 400;
+		return oauth_error("invalid_redirect_uri");
 	end
 
 	local redirect = url.parse(redirect_uri);