view mod_auth_external/examples/lua/prosody-auth-example.lua @ 2497:c6761ebe613b

mod_mam_muc: Use util.rsm (fixes #829, depends on a recent 0.10+)
author Kim Alvefur <zash@zash.se>
date Tue, 14 Feb 2017 09:40:24 +0100
parents b6280e8886f4
children
line wrap: on
line source

local actions = {};

function actions.auth(data)
	local user, host, pass = data:match("^([^:]+):([^:]+):(.+)$");
	if user == "someone" then
		return "1";
	end
end

for line in io.lines() do
	local action, data = line:match("^([^:]+)(.*)$");
	print(actions[action] and actions[action](data) or "0");
end