summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-08-13 15:18:42 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-08-13 15:18:42 +1000
commit2cf383349909e0d6ea90bab7e7a4c7e256e39130 (patch)
tree5a138c1d72527f041da91cb15777d743549dd598
parentFix OOM on large guild join (diff)
downloadserver-2cf383349909e0d6ea90bab7e7a4c7e256e39130.tar.xz
remove INVALID_PASSWORD error response. close #1090
-rw-r--r--assets/locales/af/auth.json5
-rw-r--r--src/api/routes/auth/login.ts12
2 files changed, 12 insertions, 5 deletions
diff --git a/assets/locales/af/auth.json b/assets/locales/af/auth.json
index e19547a0..46a256ca 100644
--- a/assets/locales/af/auth.json
+++ b/assets/locales/af/auth.json
@@ -1,7 +1,6 @@
 {
 	"login": {
-		"INVALID_LOGIN": "E-Mail or Phone not found",
-		"INVALID_PASSWORD": "Invalid Password",
+		"INVALID_LOGIN": "Login or password is invalid.",
 		"ACCOUNT_DISABLED": "This account is disabled"
 	},
 	"register": {
@@ -13,4 +12,4 @@
 		"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
 		"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
 	}
-}
+}
\ No newline at end of file
diff --git a/src/api/routes/auth/login.ts b/src/api/routes/auth/login.ts
index cc5a2063..a2100333 100644
--- a/src/api/routes/auth/login.ts
+++ b/src/api/routes/auth/login.ts
@@ -93,6 +93,10 @@ router.post(
 					message: req.t("auth:login.INVALID_LOGIN"),
 					code: "INVALID_LOGIN",
 				},
+				password: {
+					message: req.t("auth:login.INVALID_LOGIN"),
+					code: "INVALID_LOGIN",
+				},
 			});
 		});
 
@@ -103,9 +107,13 @@ router.post(
 		);
 		if (!same_password) {
 			throw FieldErrors({
+				login: {
+					message: req.t("auth:login.INVALID_LOGIN"),
+					code: "INVALID_LOGIN",
+				},
 				password: {
-					message: req.t("auth:login.INVALID_PASSWORD"),
-					code: "INVALID_PASSWORD",
+					message: req.t("auth:login.INVALID_LOGIN"),
+					code: "INVALID_LOGIN",
 				},
 			});
 		}