-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
login_only #3728
base: master
Are you sure you want to change the base?
login_only #3728
Changes from all commits
c676272
b3637f2
af86cdb
f524405
d3e6d7b
c3b06e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,18 +61,6 @@ module Invidious::Routes::BeforeAll | |
env.response.headers["Strict-Transport-Security"] = "max-age=31536000; includeSubDomains; preload" | ||
end | ||
|
||
return if { | ||
"/sb/", | ||
"/vi/", | ||
"/s_p/", | ||
"/yts/", | ||
"/ggpht/", | ||
"/api/manifest/", | ||
"/videoplayback", | ||
"/latest_version", | ||
"/download", | ||
}.any? { |r| env.request.resource.starts_with? r } | ||
|
||
if env.request.cookies.has_key? "SID" | ||
sid = env.request.cookies["SID"].value | ||
|
||
|
@@ -100,6 +88,24 @@ module Invidious::Routes::BeforeAll | |
end | ||
end | ||
|
||
unregistered_path_whitelist = {"/", "/login", "/licenses", "/privacy"} | ||
This comment was marked as outdated.
Sorry, something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think |
||
if CONFIG.login_only && !env.get?("user") && !unregistered_path_whitelist.includes?(env.request.path) | ||
Comment on lines
+91
to
+92
This comment was marked as outdated.
Sorry, something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is good, but I also found that Clipious client requires There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added your input to a new suggestion. |
||
env.response.headers["Location"] = "/login" | ||
haltf env, status_code: 302 | ||
Comment on lines
+93
to
+94
This comment was marked as outdated.
Sorry, something went wrong. |
||
end | ||
Comment on lines
+91
to
+95
This comment was marked as outdated.
Sorry, something went wrong. |
||
|
||
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 | ||
thin_mode = env.params.query["thin_mode"]? || preferences.thin_mode.to_s | ||
thin_mode = thin_mode == "true" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to add a descriptive comment on what this does, similar to the others.