fix: incorrect error messsage for invalid login credentials (#10117)

* fir ErrorCode enum

* update incorrect credentails message
This commit is contained in:
Purushottam Khedre authored and GitHub committed 2023-07-13 12:09:19 +00:00
1 parent c1a9f4b656
commit 352a9e2fec
5 files changed
+9 -9

No files matched your search

+1 -1
View File
@@ -69,7 +69,7 @@ export default function Login({
const errorMessages: { [key: string]: string } = {
// [ErrorCode.SecondFactorRequired]: t("2fa_enabled_instructions"),
// Don't leak information about whether an email is registered or not
[ErrorCode.IncorrectUsernamePassword]: t("incorrect_username_password"),
[ErrorCode.IncorrectEmailPassword]: t("incorrect_email_password"),
[ErrorCode.IncorrectTwoFactorCode]: `${t("incorrect_2fa_code")} ${t("please_try_again")}`,
[ErrorCode.InternalServerError]: `${t("something_went_wrong")} ${t("please_try_again_and_contact_us")}`,
[ErrorCode.ThirdPartyIdentityProviderEnabled]: t("account_created_with_identity_provider"),
+2 -2
View File
@@ -58,7 +58,7 @@ test.describe("Login and logout tests", () => {
test.describe("Login flow validations", async () => {
test("Should warn when user does not exist", async ({ page }) => {
const alertMessage = (await localize("en"))("incorrect_username_password");
const alertMessage = (await localize("en"))("incorrect_email_password");
// Login with a non-existent user
const never = "never";
@@ -69,7 +69,7 @@ test.describe("Login and logout tests", () => {
});
test("Should warn when password is incorrect", async ({ page, users }) => {
const alertMessage = (await localize("en"))("incorrect_username_password");
const alertMessage = (await localize("en"))("incorrect_email_password");
// by default password===username with the users fixture
const pro = await users.create({ username: "pro" });
@@ -477,7 +477,7 @@
"max_limit_allowed_hint": "Must be {{limit}} or fewer characters long",
"invalid_password_hint": "The password must be a minimum of {{passwordLength}} characters long containing at least one number and have a mixture of uppercase and lowercase letters",
"incorrect_password": "Password is incorrect.",
"incorrect_username_password": "Username or password is incorrect.",
"incorrect_email_password": "Email or password is incorrect.",
"use_setting": "Use setting",
"am_pm": "am/pm",
"time_options": "Time options",