Mercurial > prosody-modules
comparison mod_auth_dovecot/auth_dovecot/mod_auth_dovecot.lua @ 1212:bd88728b0d95
mod_auth_dovecot: Add a proper SASL handler method
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 11 Aug 2013 00:00:58 +0200 |
| parents | c9e2beec4ef6 |
| children | 544f5a4a8428 |
comparison
equal
deleted
inserted
replaced
| 1211:27de4109b7e9 | 1212:bd88728b0d95 |
|---|---|
| 86 if append_host then | 86 if append_host then |
| 87 function provider.test_password(username, password) | 87 function provider.test_password(username, password) |
| 88 return new_sasl(module.host):plain_test(username .. "@".. (service_realm or module.host), password); | 88 return new_sasl(module.host):plain_test(username .. "@".. (service_realm or module.host), password); |
| 89 end | 89 end |
| 90 | 90 |
| 91 provider.get_sasl_handler = nil | 91 function provider.get_sasl_handler() |
| 92 return util_sasl_new(module.host, { | |
| 93 plain_test = function(sasl, username, password, realm) | |
| 94 return provider.test_password(username, password), true | |
| 95 end; | |
| 96 }); | |
| 97 end | |
| 92 end | 98 end |
| 93 | 99 |
| 94 module:provides("auth", provider); | 100 module:provides("auth", provider); |
| 95 | 101 |
