comparison mod_auth_wordpress/mod_auth_wordpress.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 a46c2326eed7
children 7dbde05b48a9
comparison
equal deleted inserted replaced
813:2469f779b3f7 814:881ec9919144
174 if #hash == 34 then return hash; end 174 if #hash == 34 then return hash; end
175 return md5(password, true); 175 return md5(password, true);
176 end 176 end
177 177
178 178
179 provider = { name = "wordpress" }; 179 provider = {};
180 180
181 function provider.test_password(username, password) 181 function provider.test_password(username, password)
182 local hash = get_password(username); 182 local hash = get_password(username);
183 return hash and wordpressCheckHash(password, hash); 183 return hash and wordpressCheckHash(password, hash);
184 end 184 end
248 return "failure", "not-authorized", "Unable to authorize you with the authentication credentials you've sent."; 248 return "failure", "not-authorized", "Unable to authorize you with the authentication credentials you've sent.";
249 end 249 end
250 return sasl; 250 return sasl;
251 end 251 end
252 252
253 module:add_item("auth-provider", provider); 253 module:provides("auth", provider);
254 254