comparison mod_auth_internal_yubikey/mod_auth_internal_yubikey.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
parents f801ce6826d5
children 960007b0901e
comparison
equal deleted inserted replaced
813:2469f779b3f7 814:881ec9919144
44 }); 44 });
45 45
46 local global_yubikey_key = module:get_option_string("yubikey_key"); 46 local global_yubikey_key = module:get_option_string("yubikey_key");
47 47
48 function new_default_provider(host) 48 function new_default_provider(host)
49 local provider = { name = "internal_yubikey" }; 49 local provider = {};
50 log("debug", "initializing default authentication provider for host '%s'", host); 50 log("debug", "initializing default authentication provider for host '%s'", host);
51 51
52 function provider.test_password(username, password) 52 function provider.test_password(username, password)
53 log("debug", "test password '%s' for user %s at host %s", password, username, module.host); 53 log("debug", "test password '%s' for user %s at host %s", password, username, module.host);
54 54
119 end 119 end
120 120
121 return provider; 121 return provider;
122 end 122 end
123 123
124 module:add_item("auth-provider", new_default_provider(module.host)); 124 module:provides("auth", new_default_provider(module.host));
125 125
126 function module.command(arg) 126 function module.command(arg)
127 local command = arg[1]; 127 local command = arg[1];
128 table.remove(arg, 1); 128 table.remove(arg, 1);
129 if command == "associate" then 129 if command == "associate" then