mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-10 02:08:23 +00:00
@SamantazFox: Put that code before return if (on line 64)
This commit is contained in:
parent
af86cdbd38
commit
f5244055a2
@ -61,6 +61,12 @@ module Invidious::Routes::BeforeAll
|
|||||||
env.response.headers["Strict-Transport-Security"] = "max-age=31536000; includeSubDomains; preload"
|
env.response.headers["Strict-Transport-Security"] = "max-age=31536000; includeSubDomains; preload"
|
||||||
end
|
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 {
|
return if {
|
||||||
"/sb/",
|
"/sb/",
|
||||||
"/vi/",
|
"/vi/",
|
||||||
@ -122,11 +128,5 @@ module Invidious::Routes::BeforeAll
|
|||||||
end
|
end
|
||||||
|
|
||||||
env.set "current_page", URI.encode_www_form(current_page)
|
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
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user