changeset 4276:ec33b3b1136c

mod_http_oauth2: Fix passing OAuth-specific error details Error 'context' isn't preserved when passed this way, that would be the second argument. Fits better in extras anyways.
author Kim Alvefur <zash@zash.se>
date Sat, 28 Nov 2020 21:22:16 +0100
parents bb111148d031
children 10dc4527574f
files mod_http_oauth2/mod_http_oauth2.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_oauth2/mod_http_oauth2.lua	Sat Nov 28 14:14:03 2020 +0100
+++ b/mod_http_oauth2/mod_http_oauth2.lua	Sat Nov 28 21:22:16 2020 +0100
@@ -37,7 +37,7 @@
 		condition = "bad-request";
 		code = err_name == "invalid_client" and 401 or 400;
 		text = err_desc and (err_name..": "..err_desc) or err_name;
-		context = { oauth2_response = { error = err_name, error_description = err_desc } };
+		extra = { oauth2_response = { error = err_name, error_description = err_desc } };
 	});
 end
 
@@ -242,7 +242,7 @@
 local http_server = require "net.http.server";
 
 module:hook_object_event(http_server, "http-error", function (event)
-	local oauth2_response = event.error and event.error.context and event.error.context.oauth2_response;
+	local oauth2_response = event.error and event.error.extra and event.error.extra.oauth2_response;
 	if not oauth2_response then
 		return;
 	end