removed redirect_login

This commit is contained in:
Toni Förster 2023-11-13 22:02:12 +01:00
parent a563aabd5f
commit 0e98711e93
No known key found for this signature in database
GPG key ID: 292F3E5086C83FC7
3 changed files with 15 additions and 32 deletions

View file

@ -252,16 +252,6 @@ https_only: 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
## accounts allow users to subscribe to channels and to create

View file

@ -94,8 +94,6 @@ class Config
property captcha_enabled : Bool = true
# Only allow usage of the Invidious instance with an existing account
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 registration_enabled : Bool = true
property statistics_enabled : Bool = false

View file

@ -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.redirect_login && CONFIG.login_enabled
env.response.headers["Location"] = "/login"
haltf env, status_code: 302
else
env.response.status_code = 401
env.response.close
end
end
return if {