do not reauth if we are already logged in

This commit is contained in:
Kay0u 2020-05-21 22:56:52 +02:00
parent 24b3f7dc3a
commit 720e35df4e
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D

View file

@ -249,9 +249,10 @@ end
-- via cURL for example.
--
local auth_header = ngx.req.get_headers()["Authorization"]
if not is_logged_in then
local auth_header = ngx.req.get_headers()["Authorization"]
if auth_header then
if auth_header then
_, _, b64_cred = string.find(auth_header, "^Basic%s+(.+)$")
_, _, user, password = string.find(ngx.decode_base64(b64_cred), "^(.+):(.+)$")
user = hlp.authenticate(user, password)
@ -269,6 +270,7 @@ if auth_header then
end
return hlp.pass()
end
end
end
--