1aefc5b540
* shard: update to crystal 0.31.0 Additionally, no longer use the Crystal "markdown" library which has been removed from the Crystal stdlib in version 0.31.0. See https://github.com/crystal-lang/crystal/pull/8115. Also fix some deprecation warnings using the following commands: find . \( -type d -name .git -prune \) -o -type f -exec sed -i 's/URI\.escape/URI\.encode_www_form/g' "{}" \; find . \( -type d -name .git -prune \) -o -type f -exec sed -i 's/URI\.unescape/URI\.decode_www_form/g' "{}" \; sed -i 's/while \%pull\.kind \!\= \:end_object/until \%pull\.kind\.end_object\?/g' src/invidious/helpers/patch_mapping.cr
79 lines
2.8 KiB
Plaintext
79 lines
2.8 KiB
Plaintext
<% content_for "header" do %>
|
|
<title><%= translate(locale, "Token") %> - Invidious</title>
|
|
<% end %>
|
|
|
|
<% if env.get? "access_token" %>
|
|
<div class="pure-g h-box">
|
|
<div class="pure-u-1-3">
|
|
<h3>
|
|
<%= translate(locale, "Token") %>
|
|
</h3>
|
|
</div>
|
|
<div class="pure-u-1-3" style="text-align:center">
|
|
<h3>
|
|
<a href="/token_manager"><%= translate(locale, "Token manager") %></a>
|
|
</h3>
|
|
</div>
|
|
<div class="pure-u-1-3" style="text-align:right">
|
|
<h3>
|
|
<a href="/preferences"><%= translate(locale, "Preferences") %></a>
|
|
</h3>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="h-box">
|
|
<h4 style="padding-left:0.5em">
|
|
<code><%= env.get "access_token" %></code>
|
|
</h4>
|
|
</div>
|
|
<% else %>
|
|
<div class="h-box">
|
|
<form class="pure-form pure-form-aligned" action="/authorize_token" method="post">
|
|
<% if callback_url %>
|
|
<legend><%= translate(locale, "Authorize token for `x`?", "#{callback_url.scheme}://#{callback_url.host}") %></legend>
|
|
<% else %>
|
|
<legend><%= translate(locale, "Authorize token?") %></legend>
|
|
<% end %>
|
|
|
|
<div class="pure-g">
|
|
<div class="pure-u-1">
|
|
<ul>
|
|
<% scopes.each do |scope| %>
|
|
<li><%= HTML.escape(scope) %></li>
|
|
<% end %>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="pure-g">
|
|
<div class="pure-u-1-2">
|
|
<button type="submit" name="submit" value="clear_watch_history" class="pure-button pure-button-primary">
|
|
<%= translate(locale, "Yes") %>
|
|
</button>
|
|
</div>
|
|
<div class="pure-u-1-2">
|
|
<% if callback_url %>
|
|
<a class="pure-button" href="<%= callback_url %>">
|
|
<% else %>
|
|
<a class="pure-button" href="/">
|
|
<% end %>
|
|
<%= translate(locale, "No") %>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<% scopes.each_with_index do |scope, i| %>
|
|
<input type="hidden" name="scopes[<%= i %>]" value="<%= scope %>">
|
|
<% end %>
|
|
<% if callback_url %>
|
|
<input type="hidden" name="callbackUrl" value="<%= callback_url %>">
|
|
<% end %>
|
|
<% if expire %>
|
|
<input type="hidden" name="expire" value="<%= expire %>">
|
|
<% end %>
|
|
|
|
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(csrf_token) %>">
|
|
</form>
|
|
</div>
|
|
<% end %>
|