From b68bd77505362a9764a9306c1355fef69339e18c Mon Sep 17 00:00:00 2001 From: "Mehdi.Bagvand" Date: Sun, 13 Nov 2022 15:15:20 +0330 Subject: [PATCH 1/2] fix wrong error message in registration when phoneNumber threepid is in use. --- src/components/structures/auth/Registration.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/structures/auth/Registration.tsx b/src/components/structures/auth/Registration.tsx index 0ab90abb498..4d21d56f198 100644 --- a/src/components/structures/auth/Registration.tsx +++ b/src/components/structures/auth/Registration.tsx @@ -332,8 +332,6 @@ export default class Registration extends React.Component { } } else if (response.errcode === "M_USER_IN_USE") { errorText = _t("Someone already has that username, please try another."); - } else if (response.errcode === "M_THREEPID_IN_USE") { - errorText = _t("That e-mail address is already in use."); } this.setState({ From 6aaadd8086e04e68e8ef09ab8726dc5e0613353a Mon Sep 17 00:00:00 2001 From: "Mehdi.Bagvand" Date: Sun, 13 Nov 2022 20:04:23 +0330 Subject: [PATCH 2/2] showing generic translated error message instead of showing server error message when threepid is in use for registration --- src/components/structures/auth/Registration.tsx | 2 ++ src/i18n/strings/en_EN.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/structures/auth/Registration.tsx b/src/components/structures/auth/Registration.tsx index 4d21d56f198..ab88c446ef2 100644 --- a/src/components/structures/auth/Registration.tsx +++ b/src/components/structures/auth/Registration.tsx @@ -332,6 +332,8 @@ export default class Registration extends React.Component { } } else if (response.errcode === "M_USER_IN_USE") { errorText = _t("Someone already has that username, please try another."); + } else if (response.errcode === "M_THREEPID_IN_USE") { + errorText = _t("That e-mail address or phone number is already in use."); } this.setState({ diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 9af1b476f14..e383e4ff265 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -3465,7 +3465,7 @@ "Unable to query for supported registration methods.": "Unable to query for supported registration methods.", "This server does not support authentication with a phone number.": "This server does not support authentication with a phone number.", "Someone already has that username, please try another.": "Someone already has that username, please try another.", - "That e-mail address is already in use.": "That e-mail address is already in use.", + "That e-mail address or phone number is already in use.": "That e-mail address or phone number is already in use.", "Continue with %(ssoButtons)s": "Continue with %(ssoButtons)s", "%(ssoButtons)s Or %(usernamePassword)s": "%(ssoButtons)s Or %(usernamePassword)s", "Already have an account? Sign in here": "Already have an account? Sign in here",