mod_tokenauth: Handle tokens issued to bare hosts (eg components)
authorKim Alvefur <zash@zash.se>
Fri, 28 Feb 2020 14:13:04 +0100
changeset 10678 4459afac4d13
parent 10677 1a23a58ac84e
child 10679 5efd6865486c
mod_tokenauth: Handle tokens issued to bare hosts (eg components)
plugins/mod_tokenauth.lua
--- a/plugins/mod_tokenauth.lua	Thu Feb 27 20:05:47 2020 +0100
+++ b/plugins/mod_tokenauth.lua	Fri Feb 28 14:13:04 2020 +0100
@@ -30,7 +30,7 @@
 	};
 
 	local token_id = id.long();
-	local token = base64.encode("1;"..token_username.."@"..token_host..";"..token_id);
+	local token = base64.encode("1;"..jid.join(token_username, token_host)..";"..token_id);
 	token_store:set(token_username, token_id, token_info);
 
 	return token, token_info;