mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
check the config flag first
This commit is contained in:
parent
c676272604
commit
b3637f20a9
1 changed files with 1 additions and 1 deletions
|
@ -150,7 +150,7 @@ module Invidious::Routes::BeforeAll
|
|||
env.set "current_page", URI.encode_www_form(current_page)
|
||||
|
||||
unregistered_path_whitelist = {"/", "/login", "/licenses", "/privacy"}
|
||||
if !env.get?("user") && !unregistered_path_whitelist.includes?(env.request.path) && CONFIG.login_only
|
||||
if CONFIG.login_only && !env.get?("user") && !unregistered_path_whitelist.includes?(env.request.path)
|
||||
env.response.headers["Location"] = "/login"
|
||||
haltf env, status_code: 302
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue