changeset 5225:3439eb37f23b

mod_http_oauth2: token endpoint: handle missing credentials
author Matthew Wild <mwild1@gmail.com>
date Tue, 07 Mar 2023 15:33:07 +0000
parents cd5cf4cc6304
children 1756c0f929f5
files mod_http_oauth2/mod_http_oauth2.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_oauth2/mod_http_oauth2.lua	Tue Mar 07 15:31:19 2023 +0000
+++ b/mod_http_oauth2/mod_http_oauth2.lua	Tue Mar 07 15:33:07 2023 +0000
@@ -466,7 +466,7 @@
 		return error_response(event.request, oauth_error("invalid_request"));
 	end
 
-	if credentials.type == "basic" then
+	if credentials and credentials.type == "basic" then
 		params.client_id = http.urldecode(credentials.username);
 		params.client_secret = http.urldecode(credentials.password);
 	end