Change auth code 403 to 401
parent
287c65d0f2
commit
5ec574fcbb
|
@ -56,7 +56,7 @@ function _M.run(wsapi_env)
|
||||||
|
|
||||||
local status, login, password = pcall(decode_authorization, authorization)
|
local status, login, password = pcall(decode_authorization, authorization)
|
||||||
if (not status) then
|
if (not status) then
|
||||||
return 403, {}, ""
|
return 401, {["WWW-Authenticate"] = [[Basic realm="realm", charset="UTF-8"]]}, ""
|
||||||
end
|
end
|
||||||
|
|
||||||
-- make normal username
|
-- make normal username
|
||||||
|
@ -65,7 +65,7 @@ function _M.run(wsapi_env)
|
||||||
local status, err = pcall(bind, dc, username, password)
|
local status, err = pcall(bind, dc, username, password)
|
||||||
if (not status) then
|
if (not status) then
|
||||||
log(err)
|
log(err)
|
||||||
return 403, {}, ""
|
return 401, {["WWW-Authenticate"] = [[Basic realm="realm", charset="UTF-8"]]}, ""
|
||||||
end
|
end
|
||||||
|
|
||||||
return 200, {["X-LDAP-Auth-Login"] = string.lower(login)}, ""
|
return 200, {["X-LDAP-Auth-Login"] = string.lower(login)}, ""
|
||||||
|
|
Loading…
Reference in New Issue