diff --git a/src/ldap-auth-request.lua b/src/ldap-auth-request.lua index d28f024..3cc8478 100644 --- a/src/ldap-auth-request.lua +++ b/src/ldap-auth-request.lua @@ -20,6 +20,8 @@ local decode_authorization = function(header) local auth_string_b64 = string.match(header, "^Basic%s([^%s]+)$") local auth_string, _ = mime.unb64(auth_string_b64) local login, password = string.match(auth_string, "^([^:]+)[:](.+)$") + assert(login ~= nil and login ~= "", [[Login empty!]]) + assert(password ~= nil and password ~= "", [[Password empty!]]) return login, password end @@ -59,7 +61,7 @@ function _M.run(wsapi_env) -- make normal username local username = string.format("%s%s%s", login_prefix, login, login_suffix) - + local status, err = pcall(bind, dc, username, password) if (not status) then log(err)