Comparison

plugins/mod_tokenauth.lua @ 10674:4459afac4d13

mod_tokenauth: Handle tokens issued to bare hosts (eg components)
author Kim Alvefur <zash@zash.se>
date Fri, 28 Feb 2020 14:13:04 +0100
parent 10669:bf81523e2ff4
child 10675:5efd6865486c
comparison
equal deleted inserted replaced
10673:1a23a58ac84e 10674:4459afac4d13
28 auth_scope = token_scope; 28 auth_scope = token_scope;
29 }; 29 };
30 }; 30 };
31 31
32 local token_id = id.long(); 32 local token_id = id.long();
33 local token = base64.encode("1;"..token_username.."@"..token_host..";"..token_id); 33 local token = base64.encode("1;"..jid.join(token_username, token_host)..";"..token_id);
34 token_store:set(token_username, token_id, token_info); 34 token_store:set(token_username, token_id, token_info);
35 35
36 return token, token_info; 36 return token, token_info;
37 end 37 end
38 38