2019-04-19 06:23:50 +09:00
|
|
|
<% content_for "header" do %>
|
|
|
|
<title><%= translate(locale, "Token manager") %> - Invidious</title>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="pure-g h-box">
|
|
|
|
<div class="pure-u-1-3">
|
|
|
|
<h3>
|
2022-01-05 10:42:49 +09:00
|
|
|
<%= translate_count(locale, "tokens_count", tokens.size, NumberFormatting::HtmlSpan) %>
|
2019-04-19 06:23:50 +09:00
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
<div class="pure-u-1-3"></div>
|
|
|
|
<div class="pure-u-1-3" style="text-align:right">
|
|
|
|
<h3>
|
2019-09-25 02:31:33 +09:00
|
|
|
<a href="/preferences?referer=<%= URI.encode_www_form(referer) %>"><%= translate(locale, "Preferences") %></a>
|
2019-04-19 06:23:50 +09:00
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<% tokens.each do |token| %>
|
|
|
|
<div class="h-box">
|
|
|
|
<div class="pure-g<% if token[:session] == sid %> deleted <% end %>">
|
|
|
|
<div class="pure-u-3-5">
|
|
|
|
<h4 style="padding-left:0.5em">
|
|
|
|
<code><%= token[:session] %></code>
|
|
|
|
</h4>
|
|
|
|
</div>
|
|
|
|
<div class="pure-u-1-5" style="text-align:center">
|
|
|
|
<h4><%= translate(locale, "`x` ago", recode_date(token[:issued], locale)) %></h4>
|
|
|
|
</div>
|
|
|
|
<div class="pure-u-1-5" style="text-align:right">
|
|
|
|
<h3 style="padding-right:0.5em">
|
2020-03-16 06:46:08 +09:00
|
|
|
<form data-onsubmit="return_false" action="/token_ajax?action_revoke_token=1&session=<%= token[:session] %>&referer=<%= env.get("current_page") %>" method="post">
|
2021-10-12 05:35:07 +09:00
|
|
|
<input type="hidden" name="csrf_token" value="<%= HTML.escape(env.get?("csrf_token").try &.as(String) || "") %>">
|
2022-06-16 05:26:50 +09:00
|
|
|
<input style="all:unset" type="submit" data-onclick="revoke_token" data-session="<%= token[:session] %>" value="<%= translate(locale, "revoke") %>">
|
2019-04-19 06:23:50 +09:00
|
|
|
</form>
|
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<% if tokens[-1].try &.[:session]? != token[:session] %>
|
2019-05-02 10:03:39 +09:00
|
|
|
<hr>
|
2019-04-19 06:23:50 +09:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|