changeset 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 27de4109b7e9
children 544f5a4a8428
files mod_auth_dovecot/auth_dovecot/mod_auth_dovecot.lua
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_auth_dovecot/auth_dovecot/mod_auth_dovecot.lua	Sun Oct 13 04:47:51 2013 +0200
+++ b/mod_auth_dovecot/auth_dovecot/mod_auth_dovecot.lua	Sun Aug 11 00:00:58 2013 +0200
@@ -88,7 +88,13 @@
 		return new_sasl(module.host):plain_test(username .. "@".. (service_realm or module.host), password);
 	end
 
-	provider.get_sasl_handler = nil
+	function provider.get_sasl_handler()
+		return util_sasl_new(module.host, {
+			plain_test = function(sasl, username, password, realm)
+				return provider.test_password(username, password), true
+			end;
+		});
+	end
 end
 
 module:provides("auth", provider);