Merge pull request #175 from titoko/patch-1

fix(Authorization): Skipped Autorization Header that are not Basic
This commit is contained in:
Alexandre Aubin 2020-12-15 22:10:43 +01:00 committed by GitHub
commit 072e24c622
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -271,6 +271,10 @@ function refresh_logged_in()
if auth_header then
_, _, b64_cred = string.find(auth_header, "^Basic%s+(.+)$")
if b64_cred == nil then
is_logged_in = false
return is_logged_in
end
_, _, user, password = string.find(ngx.decode_base64(b64_cred), "^(.+):(.+)$")
user = authenticate(user, password)
if user then