mod_http_oauth2: Fix error due to reference loop when using refresh token
authorKim Alvefur <zash@zash.se>
Wed, 12 Apr 2023 11:24:06 +0200
changeset 5345 dcb93ffe64ae
parent 5344 cd195283127f
child 5346 e28ba69b5307
mod_http_oauth2: Fix error due to reference loop when using refresh token
mod_http_oauth2/mod_http_oauth2.lua
--- a/mod_http_oauth2/mod_http_oauth2.lua	Wed Apr 12 11:22:36 2023 +0200
+++ b/mod_http_oauth2/mod_http_oauth2.lua	Wed Apr 12 11:24:06 2023 +0200
@@ -176,6 +176,8 @@
 	else
 		-- Grant exists, reuse existing refresh token
 		refresh_token = refresh_token_info.token;
+
+		refresh_token_info.grant = nil; -- Prevent reference loop
 	end
 
 	local access_token, access_token_info = tokens.create_token(token_jid, grant, role, default_access_ttl, "oauth2");