mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
removed redirect_login
This commit is contained in:
parent
a563aabd5f
commit
0e98711e93
3 changed files with 15 additions and 32 deletions
|
@ -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
|
||||||
|
|
|
@ -102,13 +102,8 @@ module Invidious::Routes::BeforeAll
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
||||||
|
|
Loading…
Reference in a new issue