mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Add Atom feed
This commit is contained in:
parent
ac8fb9d8c8
commit
6135006b26
3 changed files with 128 additions and 7 deletions
|
@ -139,6 +139,7 @@ class User
|
|||
converter: PreferencesConverter,
|
||||
},
|
||||
password: String?,
|
||||
token: String,
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -815,13 +816,17 @@ def fetch_user(sid, client, headers, db)
|
|||
email = ""
|
||||
end
|
||||
|
||||
user = User.new(sid, Time.now, [] of String, channels, email, DEFAULT_USER_PREFERENCES, nil)
|
||||
token = Base64.encode(Random::Secure.random_bytes(32))
|
||||
|
||||
user = User.new(sid, Time.now, [] of String, channels, email, DEFAULT_USER_PREFERENCES, nil, token)
|
||||
return user
|
||||
end
|
||||
|
||||
def create_user(sid, email, password)
|
||||
password = Crypto::Bcrypt::Password.create(password, cost: 10)
|
||||
user = User.new(sid, Time.now, [] of String, [] of String, email, DEFAULT_USER_PREFERENCES, password.to_s)
|
||||
token = Base64.encode(Random::Secure.random_bytes(32))
|
||||
|
||||
user = User.new(sid, Time.now, [] of String, [] of String, email, DEFAULT_USER_PREFERENCES, password.to_s, token)
|
||||
|
||||
return user
|
||||
end
|
||||
|
|
|
@ -2,7 +2,19 @@
|
|||
<title>Subscriptions - Invidious</title>
|
||||
<% end %>
|
||||
|
||||
<h3><a href="/subscription_manager">Manage subscriptions</a></h3>
|
||||
<div class="pure-g">
|
||||
<div class="pure-u-1 pure-u-md-3-5">
|
||||
<h3>
|
||||
<a href="/subscription_manager">Manage subscriptions</a>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="pure-u-1 pure-u-md-1-5"></div>
|
||||
<div style="text-align:right;" class="pure-u-1 pure-u-md-1-5">
|
||||
<h3>
|
||||
<a href="/feed/private?token=<%= user.token %>"><i class="fas fa-rss-square"></i></a>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if !notifications.empty? %>
|
||||
<% notifications.each_slice(4) do |slice| %>
|
||||
|
@ -26,13 +38,13 @@
|
|||
<div class="pure-g">
|
||||
<div class="pure-u-1 pure-u-md-1-5">
|
||||
<% if page > 2 %>
|
||||
<a href="/feed/subscriptions?maxResults=<%= max_results %>&page=<%= page - 1 %>">Previous page</a>
|
||||
<a href="/feed/subscriptions?max_results=<%= max_results %>&page=<%= page - 1 %>">Previous page</a>
|
||||
<% else %>
|
||||
<a href="/feed/subscriptions?maxResults=<%= max_results %>">Previous page</a>
|
||||
<a href="/feed/subscriptions?max_results=<%= max_results %>">Previous page</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="pure-u-1 pure-u-md-3-5"></div>
|
||||
<div style="text-align:right;" class="pure-u-1 pure-u-md-1-5">
|
||||
<a href="/feed/subscriptions?maxResults=<%= max_results %>&page=<%= page + 1 %>">Next page</a>
|
||||
<a href="/feed/subscriptions?max_results=<%= max_results %>&page=<%= page + 1 %>">Next page</a>
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue