summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-04-17 17:54:33 -0500
committerOmar Roth <omarroth@hotmail.com>2018-04-28 09:29:08 -0500
commit19f5729e181fca3f2a07b6b3dab47dd3a4584a22 (patch)
tree531aed7ec654aaaec9f61651db57fea96b69d310
parent7621c8ef2d24ae949afdb086a27562a7db395c61 (diff)
downloadinvidious-19f5729e181fca3f2a07b6b3dab47dd3a4584a22.tar.gz
invidious-19f5729e181fca3f2a07b6b3dab47dd3a4584a22.tar.bz2
invidious-19f5729e181fca3f2a07b6b3dab47dd3a4584a22.zip
Add support for incorrect password on /login
-rw-r--r--src/invidious.cr5
1 files changed, 5 insertions, 0 deletions
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)