view mod_auth_external/examples/lua/prosody-auth-example.lua @ 2148:c472a454be61

mod_smacks: Fix sending <r> after stanzas while not creating multiple timers (thanks Thilo)
author Kim Alvefur <zash@zash.se>
date Sat, 02 Apr 2016 20:03:30 +0200
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