aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2022-10-13 22:46:19 +0100
committerMatthew Wild <mwild1@gmail.com>2022-10-13 22:46:19 +0100
commit32c38bc24958581e0c21e4143fbd94e02dde2c22 (patch)
treed7396077b8fccad1872ced62e57d018c2b614904 /plugins
parentf081c1a756269972c1d6c8b0caf5995005fbdb21 (diff)
downloadprosody-32c38bc24958581e0c21e4143fbd94e02dde2c22.tar.gz
prosody-32c38bc24958581e0c21e4143fbd94e02dde2c22.zip
mod_tokenauth: Allow attaching an arbitrary data table to a token
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_tokenauth.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_tokenauth.lua b/plugins/mod_tokenauth.lua
index 22d2199a..9cd73570 100644
--- a/plugins/mod_tokenauth.lua
+++ b/plugins/mod_tokenauth.lua
@@ -13,7 +13,7 @@ local function select_role(username, host, role)
return usermanager.get_user_role(username, host);
end
-function create_jid_token(actor_jid, token_jid, token_role, token_ttl)
+function create_jid_token(actor_jid, token_jid, token_role, token_ttl, token_data)
token_jid = jid.prep(token_jid);
if not actor_jid or token_jid ~= actor_jid and not jid.compare(token_jid, actor_jid) then
return nil, "not-authorized";
@@ -33,6 +33,7 @@ function create_jid_token(actor_jid, token_jid, token_role, token_ttl)
resource = token_resource;
role = token_role;
+ data = token_data;
};
local token_id = id.long();