Software / code / prosody-modules
Comparison
mod_auth_external/mod_auth_external.lua @ 814:881ec9919144
mod_auth_*: Use module:provides(), and don't explicitly specify provider.name.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Thu, 13 Sep 2012 00:08:29 +0500 |
| parent | 342:8e9e5c7d97ff |
| child | 816:960007b0901e |
comparison
equal
deleted
inserted
replaced
| 813:2469f779b3f7 | 814:881ec9919144 |
|---|---|
| 92 return nil, "internal-server-error"; | 92 return nil, "internal-server-error"; |
| 93 end | 93 end |
| 94 end | 94 end |
| 95 | 95 |
| 96 function new_external_provider(host) | 96 function new_external_provider(host) |
| 97 local provider = { name = "external" }; | 97 local provider = {}; |
| 98 | 98 |
| 99 function provider.test_password(username, password) | 99 function provider.test_password(username, password) |
| 100 return do_query("auth", username, password); | 100 return do_query("auth", username, password); |
| 101 end | 101 end |
| 102 | 102 |
| 140 end | 140 end |
| 141 | 141 |
| 142 return provider; | 142 return provider; |
| 143 end | 143 end |
| 144 | 144 |
| 145 module:add_item("auth-provider", new_external_provider(module.host)); | 145 module:provides("auth", new_external_provider(module.host)); |