mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Add fix for testing authentication
This commit is contained in:
parent
908543dd62
commit
15f4d95ab4
2 changed files with 4 additions and 4 deletions
|
@ -164,8 +164,8 @@ spawn do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
before_get do |env|
|
before_all do |env|
|
||||||
if env.request.cookies["SID"]?
|
if env.request.cookies.has_key?("SID")
|
||||||
env.set "authorized", true
|
env.set "authorized", true
|
||||||
else
|
else
|
||||||
env.set "authorized", false
|
env.set "authorized", false
|
||||||
|
@ -551,7 +551,7 @@ end
|
||||||
|
|
||||||
# Get subscriptions for authorized user
|
# Get subscriptions for authorized user
|
||||||
get "/feed/subscriptions" do |env|
|
get "/feed/subscriptions" do |env|
|
||||||
authorized = env.get "authorized"
|
authorized = env.get? "authorized"
|
||||||
|
|
||||||
if authorized
|
if authorized
|
||||||
max_results = env.params.query["maxResults"]?.try &.to_i
|
max_results = env.params.query["maxResults"]?.try &.to_i
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="pure-u-1 pure-u-md-1-5">
|
<div class="pure-u-1 pure-u-md-1-5">
|
||||||
<% if env.get "authorized" %>
|
<% if env.get? "authorized" %>
|
||||||
<div class="pure-g">
|
<div class="pure-g">
|
||||||
<div class="pure-u-1 pure-u-md-1-3">
|
<div class="pure-u-1 pure-u-md-1-3">
|
||||||
<a href="/feed/subscriptions" class="pure-menu-heading">
|
<a href="/feed/subscriptions" class="pure-menu-heading">
|
||||||
|
|
Loading…
Reference in a new issue