diff options
author | ngn <ngn13proton@proton.me> | 2023-06-10 22:17:50 +0300 |
---|---|---|
committer | ngn <ngn13proton@proton.me> | 2023-06-10 22:17:50 +0300 |
commit | 3dcabc57f659ea9e664711a5069e0fa908a04676 (patch) | |
tree | 71f33f6c766c06ed3c28209a6fa6dd6d0c23fb96 | |
parent | making min password length configurable (diff) | |
download | server-3dcabc57f659ea9e664711a5069e0fa908a04676.tar.xz |
Making the error message dynamic
-rw-r--r-- | assets/locales/ur/auth.json | 2 | ||||
-rw-r--r-- | src/api/routes/auth/register.ts | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/assets/locales/ur/auth.json b/assets/locales/ur/auth.json index ed7dc26d..1dac2474 100644 --- a/assets/locales/ur/auth.json +++ b/assets/locales/ur/auth.json @@ -10,7 +10,7 @@ "EMAIL_INVALID": "Invalid Email", "EMAIL_ALREADY_REGISTERED": "Email is already registered", "DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older", - "PASSWORD_REQUIREMENTS_MIN_LENGTH": "Must be at least 8 characters long.", + "PASSWORD_REQUIREMENTS_MIN_LENGTH": "Must be at least {{min}} characters long.", "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" } diff --git a/src/api/routes/auth/register.ts b/src/api/routes/auth/register.ts index f8bc6da2..247fa88f 100644 --- a/src/api/routes/auth/register.ts +++ b/src/api/routes/auth/register.ts @@ -229,7 +229,7 @@ router.post( throw FieldErrors({ password: { code: "PASSWORD_REQUIREMENTS_MIN_LENGTH", - message: req.t("auth:register.PASSWORD_REQUIREMENTS_MIN_LENGTH") + message: req.t("auth:register.PASSWORD_REQUIREMENTS_MIN_LENGTH", { min: register.password.minLength }) } }); } |