From: rosenjcb <rosenjcb@gmail.com>
Date: Wed, 12 Jul 2023 14:01:47 +0000 (-0700)
Subject: Add Toast Messages for Bad Logins (#1874)
X-Git-Url: http://these/git/%7B%60%24%7BarchiveTodayUrl%7D/%24%7B%60data:application/static/git-favicon.png?a=commitdiff_plain;h=7a804ff33323615b727c1cc8172e168e354f11db;p=lemmy-ui.git

Add Toast Messages for Bad Logins (#1874)

* Added toast prompts

* Using generic  message instead.

---------

Co-authored-by: Jacob Rosenzweig <rosenjcb@Jacobs-MacBook-Pro.local>
Co-authored-by: SleeplessOne1917 <abias1122@gmail.com>
---

diff --git a/src/shared/components/home/login.tsx b/src/shared/components/home/login.tsx
index e2986b5..62e5721 100644
--- a/src/shared/components/home/login.tsx
+++ b/src/shared/components/home/login.tsx
@@ -169,6 +169,9 @@ export class Login extends Component<any, State> {
             i.setState({ showTotp: true });
             toast(I18NextService.i18n.t("enter_two_factor_code"), "info");
           }
+          if (loginRes.msg === "incorrect_login") {
+            toast(I18NextService.i18n.t("incorrect_login"), "danger");
+          }
 
           i.setState({ loginRes: { state: "failed", msg: loginRes.msg } });
           break;