Mercurial > prosody-modules
comparison mod_auth_external_insecure/examples/lua/prosody-auth-example.lua @ 3884:f84ede3e9e3b
mod_auth_external->mod_auth_external_insecure: Unmaintained and almost certainly insecure, discourage its use
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 06 Feb 2020 21:03:17 +0000 |
parents | mod_auth_external/examples/lua/prosody-auth-example.lua@b6280e8886f4 |
children |
comparison
equal
deleted
inserted
replaced
3883:571249f69577 | 3884:f84ede3e9e3b |
---|---|
1 local actions = {}; | |
2 | |
3 function actions.auth(data) | |
4 local user, host, pass = data:match("^([^:]+):([^:]+):(.+)$"); | |
5 if user == "someone" then | |
6 return "1"; | |
7 end | |
8 end | |
9 | |
10 for line in io.lines() do | |
11 local action, data = line:match("^([^:]+)(.*)$"); | |
12 print(actions[action] and actions[action](data) or "0"); | |
13 end |