Diff

mod_auth_custom_http/mod_auth_custom_http.lua @ 2867:94d8960385aa

mod_auth_custom_http: Fix json.encode impoper reference
author Senya <senya@kinetiksoft.com>
date Wed, 31 Jan 2018 22:15:27 +0200
parent 1343:7dbde05b48a9
child 3989:32d7f05e062f
line wrap: on
line diff
--- a/mod_auth_custom_http/mod_auth_custom_http.lua	Tue Jan 30 20:04:55 2018 +0100
+++ b/mod_auth_custom_http/mod_auth_custom_http.lua	Wed Jan 31 22:15:27 2018 +0200
@@ -6,7 +6,7 @@
 --
 
 local new_sasl = require "util.sasl".new;
-local json_encode = require "util.json";
+local json = require "util.json";
 local http = require "socket.http";
 
 local options = module:get_option("auth_custom_http");
@@ -42,7 +42,7 @@
 function provider.get_sasl_handler()
 	local getpass_authentication_profile = {
 		plain_test = function(sasl, username, password, realm)
-			local postdata = json_encode({ username = username, password = password });
+			local postdata = json.encode({ username = username, password = password });
 			local result = http.request(post_url, postdata);
 			return result == "true", true;
 		end,
@@ -52,4 +52,3 @@
 
 
 module:provides("auth", provider);
-