mod_auth_external/examples/lua/prosody-auth-example.lua
author Kim Alvefur <zash@zash.se>
Mon, 28 May 2018 14:44:53 +0200
changeset 3057 2ad35f08bd57
parent 1164 b6280e8886f4
permissions -rw-r--r--
mod_deny_omemo: Prevents publishing and retreival of OMEMO PEP nodes

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