mirror of
https://github.com/iv-org/invidious.git
synced 2024-06-07 19:40:52 +00:00
removed redirect_login
This commit is contained in:
parent
a563aabd5f
commit
0e98711e93
@ -252,16 +252,6 @@ https_only: false
|
|||||||
##
|
##
|
||||||
#private_instance: false
|
#private_instance: false
|
||||||
|
|
||||||
##
|
|
||||||
## Redirect request to the login page on private instances. Also requires
|
|
||||||
## login_enabled to be 'true', otherwise the server sends status code 401
|
|
||||||
## and closes the connection.
|
|
||||||
##
|
|
||||||
## Accepted values: true, false
|
|
||||||
## Default: false
|
|
||||||
##
|
|
||||||
#redirect_login: false
|
|
||||||
|
|
||||||
##
|
##
|
||||||
## Allow/Forbid Invidious (local) account creation. Invidious
|
## Allow/Forbid Invidious (local) account creation. Invidious
|
||||||
## accounts allow users to subscribe to channels and to create
|
## accounts allow users to subscribe to channels and to create
|
||||||
|
@ -94,8 +94,6 @@ class Config
|
|||||||
property captcha_enabled : Bool = true
|
property captcha_enabled : Bool = true
|
||||||
# Only allow usage of the Invidious instance with an existing account
|
# Only allow usage of the Invidious instance with an existing account
|
||||||
property private_instance : Bool = false
|
property private_instance : Bool = false
|
||||||
# Redirected requests to the login page on a private instance. Requires login_enabled: true
|
|
||||||
property redirect_login : Bool = false
|
|
||||||
property login_enabled : Bool = true
|
property login_enabled : Bool = true
|
||||||
property registration_enabled : Bool = true
|
property registration_enabled : Bool = true
|
||||||
property statistics_enabled : Bool = false
|
property statistics_enabled : Bool = false
|
||||||
|
@ -99,31 +99,26 @@ module Invidious::Routes::BeforeAll
|
|||||||
"/feed/webhook/v1:",
|
"/feed/webhook/v1:",
|
||||||
"/api/v1/videos/dQw4w9WgXcQ",
|
"/api/v1/videos/dQw4w9WgXcQ",
|
||||||
"/api/v1/comments/jNQXAC9IVRw",
|
"/api/v1/comments/jNQXAC9IVRw",
|
||||||
}
|
}
|
||||||
|
|
||||||
if CONFIG.private_instance && !env.get?("user") && !unregistered_path_whitelist.any? { |r| env.request.path.starts_with? r }
|
if CONFIG.private_instance && !env.get?("user") && !unregistered_path_whitelist.any? { |r| env.request.path.starts_with? r }
|
||||||
if CONFIG.redirect_login && CONFIG.login_enabled
|
env.response.headers["Location"] = "/login"
|
||||||
env.response.headers["Location"] = "/login"
|
haltf env, status_code: 302
|
||||||
haltf env, status_code: 302
|
|
||||||
else
|
|
||||||
env.response.status_code = 401
|
|
||||||
env.response.close
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return if {
|
return if {
|
||||||
"/sb/",
|
"/sb/",
|
||||||
"/vi/",
|
"/vi/",
|
||||||
"/s_p/",
|
"/s_p/",
|
||||||
"/yts/",
|
"/yts/",
|
||||||
"/ggpht/",
|
"/ggpht/",
|
||||||
"/download",
|
"/download",
|
||||||
"/licenses",
|
"/licenses",
|
||||||
"/api/manifest/",
|
"/api/manifest/",
|
||||||
"/videoplayback",
|
"/videoplayback",
|
||||||
"/latest_version",
|
"/latest_version",
|
||||||
"/opensearch.xml",
|
"/opensearch.xml",
|
||||||
}.any? { |r| env.request.resource.starts_with? r }
|
}.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
|
||||||
|
Loading…
Reference in New Issue
Block a user