From 7494e864b42eddea0245ac5d0db79d6b0da286f6 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Mon, 16 Jul 2018 12:50:41 -0500 Subject: [PATCH] Add handling for invalid login --- src/invidious.cr | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index 82b8d0ed4..14408a951 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