comparison mod_auth_custom_http/mod_auth_custom_http.lua @ 1045:76668bb122c2

mod_auth_custom_http: No need for nodeprep in Prosody 0.9.
author Waqas Hussain <waqas20@gmail.com>
date Mon, 03 Jun 2013 07:57:12 -0400
parents fcb9bf7ac107
children b9d47487d550
comparison
equal deleted inserted replaced
1044:fcb9bf7ac107 1045:76668bb122c2
36 end 36 end
37 37
38 function provider.get_sasl_handler() 38 function provider.get_sasl_handler()
39 local getpass_authentication_profile = { 39 local getpass_authentication_profile = {
40 plain_test = function(sasl, username, password, realm) 40 plain_test = function(sasl, username, password, realm)
41 local prepped_username = nodeprep(username);
42 if not prepped_username then
43 log("debug", "NODEprep failed on username: %s", username);
44 return "", nil;
45 end
46 local postdata = require "util.json".encode({ username = username, password = password }); 41 local postdata = require "util.json".encode({ username = username, password = password });
47 local result = require "socket.http".request("http://example.com/path", postdata); 42 local result = require "socket.http".request("http://example.com/path", postdata);
48 return result == "true", true; 43 return result == "true", true;
49 end, 44 end,
50 }; 45 };