Add assert for login/password
parent
1c78a3703a
commit
0182a4676a
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue