summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-07-16 12:50:41 -0500
committerOmar Roth <omarroth@hotmail.com>2018-07-16 12:50:41 -0500
commit7494e864b42eddea0245ac5d0db79d6b0da286f6 (patch)
treed25a3e13b207c22d8988eaa1517d09f14849960b /src
parent58b5e97fc4310491d4301274d4895bbfca36ef0d (diff)
downloadinvidious-7494e864b42eddea0245ac5d0db79d6b0da286f6.tar.gz
invidious-7494e864b42eddea0245ac5d0db79d6b0da286f6.tar.bz2
invidious-7494e864b42eddea0245ac5d0db79d6b0da286f6.zip
Add handling for invalid login
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 82b8d0ed..14408a95 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -220,10 +220,13 @@ before_all do |env|
sid = env.request.cookies["SID"].value
- client = make_client(YT_URL)
- user = get_user(sid, client, headers, PG_DB, false)
+ begin
+ client = make_client(YT_URL)
+ user = get_user(sid, client, headers, PG_DB, false)
- env.set "user", user
+ env.set "user", user
+ rescue ex
+ end
end
end