From 19f5729e181fca3f2a07b6b3dab47dd3a4584a22 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Tue, 17 Apr 2018 17:54:33 -0500 Subject: [PATCH] Add support for incorrect password on /login --- src/invidious.cr | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/invidious.cr b/src/invidious.cr index 875a28a5..a2afcd36 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -482,6 +482,11 @@ post "/login" do |env| challenge_results = challenge_results[5..-1] challenge_results = JSON.parse(challenge_results) + if challenge_results[0][5]?.try &.[5] == "INCORRECT_ANSWER_ENTERED" + error_message = "Incorrect password" + next templated "error" + end + login_res = challenge_results[0][13][2].to_s login = client.get(login_res, headers)