mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
@SamantazFox: Put that code before return if (on line 64)
This commit is contained in:
parent
af86cdbd38
commit
f5244055a2
1 changed files with 6 additions and 6 deletions
|
@ -61,6 +61,12 @@ module Invidious::Routes::BeforeAll
|
|||
env.response.headers["Strict-Transport-Security"] = "max-age=31536000; includeSubDomains; preload"
|
||||
end
|
||||
|
||||
unregistered_path_whitelist = {"/", "/login", "/licenses", "/privacy"}
|
||||
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
|
||||
|
||||
return if {
|
||||
"/sb/",
|
||||
"/vi/",
|
||||
|
@ -122,11 +128,5 @@ module Invidious::Routes::BeforeAll
|
|||
end
|
||||
|
||||
env.set "current_page", URI.encode_www_form(current_page)
|
||||
|
||||
unregistered_path_whitelist = {"/", "/login", "/licenses", "/privacy"}
|
||||
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
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue