diff mod_http_oauth2/mod_http_oauth2.lua @ 5341:dcb93ffe64ae

mod_http_oauth2: Fix error due to reference loop when using refresh token
author Kim Alvefur <zash@zash.se>
date Wed, 12 Apr 2023 11:24:06 +0200
parents cd195283127f
children 39d59d857bfb
line wrap: on
line diff
--- 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");