Diff

mod_http_oauth2/mod_http_oauth2.lua @ 5462:f6d8830a83fe

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.
author Kim Alvefur <zash@zash.se>
date Wed, 17 May 2023 16:34:19 +0200
parent 5461:06640647d193
child 5463:dacde53467f3
line wrap: on
line diff
--- 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);