Change auth code 403 to 401

master
Евгений Макаров 2021-07-21 12:25:40 +05:00
parent 287c65d0f2
commit 5ec574fcbb
1 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ function _M.run(wsapi_env)
local status, login, password = pcall(decode_authorization, authorization)
if (not status) then
return 403, {}, ""
return 401, {["WWW-Authenticate"] = [[Basic realm="realm", charset="UTF-8"]]}, ""
end
-- make normal username
@ -65,7 +65,7 @@ function _M.run(wsapi_env)
local status, err = pcall(bind, dc, username, password)
if (not status) then
log(err)
return 403, {}, ""
return 401, {["WWW-Authenticate"] = [[Basic realm="realm", charset="UTF-8"]]}, ""
end
return 200, {["X-LDAP-Auth-Login"] = string.lower(login)}, ""