diff mod_unified_push/mod_unified_push.lua @ 5146:a86022d702b2

mod_unified_push: Fix JWT method parameter order (fixes #1791)
author Matthew Wild <mwild1@gmail.com>
date Fri, 13 Jan 2023 16:40:00 +0000
parents 449e4ca4de32
children 658658ea9323
line wrap: on
line diff
--- a/mod_unified_push/mod_unified_push.lua	Fri Jan 13 16:28:08 2023 +0100
+++ b/mod_unified_push/mod_unified_push.lua	Fri Jan 13 16:40:00 2023 +0000
@@ -25,12 +25,13 @@
 
 -- COMPAT w/0.12
 local function jwt_sign(data)
-	return jwt.sign(data, unified_push_secret);
+	return jwt.sign(unified_push_secret, data);
 end
 
 -- COMPAT w/0.12: add expiry check
 local function jwt_verify(token)
-	local ok, result = jwt.verify(token, unified_push_secret);
+	local ok, result = jwt.verify(unified_push_secret, token);
+
 	if not ok then
 		return ok, result;
 	end