From 9c3f3a04e7cac08670a585231f8e20baff21a7f5 Mon Sep 17 00:00:00 2001 From: Michele Righi Date: Thu, 23 May 2024 16:01:21 +0200 Subject: [PATCH] Fix #11281 Features: - Store the JWT object in request context; --- apisix/plugins/jwt-auth.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apisix/plugins/jwt-auth.lua b/apisix/plugins/jwt-auth.lua index a942d0bdc220e..cef6148291a48 100644 --- a/apisix/plugins/jwt-auth.lua +++ b/apisix/plugins/jwt-auth.lua @@ -433,6 +433,9 @@ function _M.rewrite(conf, ctx) core.log.warn("Failed to verify JWT: ", jwt_obj.reason) return 401, {message = "Failed to verify JWT"} end + + -- Store the JWT object in request context + ctx.jwt_obj = jwt_obj consumer_mod.attach_consumer(ctx, consumer, consumer_conf) core.log.info("Hit jwt-auth rewrite")