comparison mod_invites/mod_invites.lua @ 4081:3c18d8deeb38

mod_invites: Fix potential traceback when invalid token used (from Snikket)
author Matthew Wild <mwild1@gmail.com>
date Mon, 07 Sep 2020 13:04:01 +0100
parents 14a3f5223074
children 24f4eb35ab60
comparison
equal deleted inserted replaced
4080:14a3f5223074 4081:3c18d8deeb38
108 if username then -- token being used for subscription 108 if username then -- token being used for subscription
109 -- Fetch from user store (subscription invite) 109 -- Fetch from user store (subscription invite)
110 valid_until = token_storage:get(username, token); 110 valid_until = token_storage:get(username, token);
111 else -- token being used for account creation 111 else -- token being used for account creation
112 valid_until = token_info and token_info.expires; 112 valid_until = token_info and token_info.expires;
113 if token_info.type == "roster" then 113 if token_info and token_info.type == "roster" then
114 username = jid_node(token_info.jid); 114 username = jid_node(token_info.jid);
115 inviter = username; 115 inviter = username;
116 end 116 end
117 end 117 end
118 118