From f021ff1374d7fa01af7e2bdcbfe96dff1fba18d0 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 10 Oct 2021 23:36:49 +0100 Subject: [PATCH] overwriting message on failed login --- src/js/account-controller.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/js/account-controller.js b/src/js/account-controller.js index 29de43aed..cf993a8c0 100644 --- a/src/js/account-controller.js +++ b/src/js/account-controller.js @@ -141,7 +141,13 @@ export function signIn() { //TODO: redirect user to relevant page }) .catch(function (error) { - Notifications.add(error.message, -1); + let message = error.message; + if (error.code === "auth/wrong-password") { + message = "Incorrect password."; + } else if (error.code === "auth/user-not-found") { + message = "User not found."; + } + Notifications.add(message, -1); $(".pageLogin .preloader").addClass("hidden"); }); });