# HG changeset patch # User Kim Alvefur # Date 1582895584 -3600 # Node ID 4459afac4d13452c75ba5f2cb73d6c029c6af41e # Parent 1a23a58ac84e14a0fcc8f17f3cd87fac7c40621e mod_tokenauth: Handle tokens issued to bare hosts (eg components) diff -r 1a23a58ac84e -r 4459afac4d13 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;