forked from Fijxu/invidious
Tokens: Option to disable user tokens.
This commit is contained in:
parent
20ebfedca5
commit
7a1d294543
4 changed files with 13 additions and 4 deletions
|
@ -189,6 +189,8 @@ class Config
|
||||||
|
|
||||||
property pubsub_domain : String = ""
|
property pubsub_domain : String = ""
|
||||||
|
|
||||||
|
property ignore_user_tokens : Bool = false
|
||||||
|
|
||||||
# Materialious redirects
|
# Materialious redirects
|
||||||
property materialious_domain : String?
|
property materialious_domain : String?
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,13 @@
|
||||||
module Invidious::Routes::Watch
|
module Invidious::Routes::Watch
|
||||||
def self.handle(env)
|
def self.handle(env)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
locale = env.get("preferences").as(Preferences).locale
|
||||||
|
if !CONFIG.ignore_user_tokens
|
||||||
user_po_token = env.get("preferences").as(Preferences).po_token
|
user_po_token = env.get("preferences").as(Preferences).po_token
|
||||||
user_visitor_data = env.get("preferences").as(Preferences).visitor_data
|
user_visitor_data = env.get("preferences").as(Preferences).visitor_data
|
||||||
|
else
|
||||||
|
user_po_token = ""
|
||||||
|
user_visitor_data = ""
|
||||||
|
end
|
||||||
|
|
||||||
region = env.params.query["region"]?
|
region = env.params.query["region"]?
|
||||||
|
|
||||||
|
|
|
@ -126,6 +126,7 @@
|
||||||
<input name="save_player_pos" id="save_player_pos" type="checkbox" <% if preferences.save_player_pos %>checked<% end %>>
|
<input name="save_player_pos" id="save_player_pos" type="checkbox" <% if preferences.save_player_pos %>checked<% end %>>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<% if !CONFIG.ignore_user_tokens %>
|
||||||
<div class="pure-control-group">
|
<div class="pure-control-group">
|
||||||
<label for="po_token"><%= translate(locale, "preferences_po_token") %></label>
|
<label for="po_token"><%= translate(locale, "preferences_po_token") %></label>
|
||||||
<input name="po_token" id="po_token" type="text" value="<%= preferences.po_token %>">
|
<input name="po_token" id="po_token" type="text" value="<%= preferences.po_token %>">
|
||||||
|
@ -140,6 +141,7 @@
|
||||||
<div class="pure-control-group">
|
<div class="pure-control-group">
|
||||||
<a href="/generate_tokens?referer=<%= URI.encode_www_form(referer) %>"><%= translate(locale, "Generate po_token and visitor_data for your account") %></a>
|
<a href="/generate_tokens?referer=<%= URI.encode_www_form(referer) %>"><%= translate(locale, "Generate po_token and visitor_data for your account") %></a>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<legend><%= translate(locale, "preferences_category_visual") %></legend>
|
<legend><%= translate(locale, "preferences_category_visual") %></legend>
|
||||||
|
|
Loading…
Reference in a new issue