diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-11-17 13:26:24 -0600 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-11-17 13:26:24 -0600 |
| commit | cd482cfd8930b11d04329c91f46ee2a1b5f08ca8 (patch) | |
| tree | 7bbf86ce2648e12e291790c41459047370e9ff7d /src/invidious.cr | |
| parent | d185ba84bf3dff26ed715ad6f318d26af0192fd5 (diff) | |
| download | invidious-cd482cfd8930b11d04329c91f46ee2a1b5f08ca8.tar.gz invidious-cd482cfd8930b11d04329c91f46ee2a1b5f08ca8.tar.bz2 invidious-cd482cfd8930b11d04329c91f46ee2a1b5f08ca8.zip | |
Add more informative error response on incorrect CAPTCHA
Diffstat (limited to 'src/invidious.cr')
| -rw-r--r-- | src/invidious.cr | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index 88663e3e..37bb6d43 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -831,7 +831,12 @@ post "/login" do |env| begin validate_response(challenge, token, answer, "sign_in", HMAC_KEY, PG_DB) rescue ex - error_message = ex.message + if ex.message && ex.message == "Invalid user" + error_message = "Invalid CAPTCHA response" + else + error_message = ex.message + end + next templated "error" end |
