Hm.
This commit is contained in:
parent
dde4119e50
commit
a870906698
@ -100,6 +100,24 @@ module Invidious::Routes::BeforeAll
|
|||||||
end
|
end
|
||||||
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 {
|
||||||
|
"/sb/",
|
||||||
|
"/vi/",
|
||||||
|
"/s_p/",
|
||||||
|
"/yts/",
|
||||||
|
"/ggpht/",
|
||||||
|
"/api/manifest/",
|
||||||
|
"/videoplayback",
|
||||||
|
"/latest_version",
|
||||||
|
"/download",
|
||||||
|
}.any? { |r| env.request.resource.starts_with? r }
|
||||||
|
|
||||||
dark_mode = convert_theme(env.params.query["dark_mode"]?) || preferences.dark_mode.to_s
|
dark_mode = convert_theme(env.params.query["dark_mode"]?) || preferences.dark_mode.to_s
|
||||||
thin_mode = env.params.query["thin_mode"]? || preferences.thin_mode.to_s
|
thin_mode = env.params.query["thin_mode"]? || preferences.thin_mode.to_s
|
||||||
thin_mode = thin_mode == "true"
|
thin_mode = thin_mode == "true"
|
||||||
@ -122,11 +140,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 !env.get?("user") && !unregistered_path_whitelist.includes?(env.request.path) && CONFIG.login_only
|
|
||||||
env.response.headers["Location"] = "/login"
|
|
||||||
haltf env, status_code: 302
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user