Check login is disabled before accessing default username

This commit is contained in:
Alex Ling 2021-01-09 06:35:26 +00:00
parent cb723acef7
commit 00e19399d7

View File

@ -75,7 +75,8 @@ class AuthHandler < Kemal::Handler
# this is why we check the default username first before checking the
# token.
should_reject = true
if Storage.default.username_is_admin Config.current.default_username
if Config.current.disable_login &&
Storage.default.username_is_admin Config.current.default_username
should_reject = false
end
if env.session.string? "token"