Mercurial > prosody-modules
comparison mod_auth_http_async/mod_auth_http_async.lua @ 1749:39a0a35f02bc
mod_auth_http_async: Don't go throug usermanager to call a function from the same module
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 18 May 2015 22:41:19 +0200 |
| parents | 295c30e44ba8 |
| children | 439711709d29 |
comparison
equal
deleted
inserted
replaced
| 1748:0697fbef9134 | 1749:39a0a35f02bc |
|---|---|
| 5 -- | 5 -- |
| 6 -- This project is MIT/X11 licensed. Please see the | 6 -- This project is MIT/X11 licensed. Please see the |
| 7 -- COPYING file in the source package for more information. | 7 -- COPYING file in the source package for more information. |
| 8 -- | 8 -- |
| 9 | 9 |
| 10 local usermanager = require "core.usermanager"; | |
| 11 local new_sasl = require "util.sasl".new; | 10 local new_sasl = require "util.sasl".new; |
| 12 local base64 = require "util.encodings".base64.encode; | 11 local base64 = require "util.encodings".base64.encode; |
| 13 local waiter =require "util.async".waiter; | 12 local waiter =require "util.async".waiter; |
| 14 local http = require "net.http"; | 13 local http = require "net.http"; |
| 15 | 14 |
| 64 end | 63 end |
| 65 | 64 |
| 66 function provider.get_sasl_handler() | 65 function provider.get_sasl_handler() |
| 67 return new_sasl(host, { | 66 return new_sasl(host, { |
| 68 plain_test = function(sasl, username, password, realm) | 67 plain_test = function(sasl, username, password, realm) |
| 69 return usermanager.test_password(username, realm, password), true; | 68 return provider.test_password(username, realm, password), true; |
| 70 end | 69 end |
| 71 }); | 70 }); |
| 72 end | 71 end |
| 73 | 72 |
| 74 module:provides("auth", provider); | 73 module:provides("auth", provider); |
