view mod_auth_external/examples/lua/prosody-auth-example.lua @ 3591:3f8383c5a045

mod_http_muc_log: Fix Y10k bug Mostly in preparation for the next commit
author Kim Alvefur <zash@zash.se>
date Mon, 13 May 2019 00:20:19 +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