mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
fix(connected-accounts): guide the user to enter the existing account's password when merging by email
The backend account-takeover fix now requires the existing account's password before merging an email that already belongs to another account. Show a clear message (profile.emailMergePasswordRequired) on that response instead of the generic "already registered" dead-end, so the legitimate owner knows to enter that account's password (in both password fields) to complete the merge. i18n in ru/en/zh/fa.
This commit is contained in:
@@ -4594,7 +4594,8 @@
|
|||||||
"vk": "VK"
|
"vk": "VK"
|
||||||
},
|
},
|
||||||
"backToAccounts": "Back to accounts"
|
"backToAccounts": "Back to accounts"
|
||||||
}
|
},
|
||||||
|
"emailMergePasswordRequired": "This email already belongs to another account. To merge the accounts, enter that account's password."
|
||||||
},
|
},
|
||||||
"theme": {
|
"theme": {
|
||||||
"colors": "Theme Colors",
|
"colors": "Theme Colors",
|
||||||
|
|||||||
@@ -4139,7 +4139,8 @@
|
|||||||
"vk": "VK"
|
"vk": "VK"
|
||||||
},
|
},
|
||||||
"backToAccounts": "بازگشت به فهرست حسابها"
|
"backToAccounts": "بازگشت به فهرست حسابها"
|
||||||
}
|
},
|
||||||
|
"emailMergePasswordRequired": "این ایمیل قبلاً به حساب دیگری تعلق دارد. برای ادغام حسابها، رمز عبور آن حساب را وارد کنید."
|
||||||
},
|
},
|
||||||
"theme": {
|
"theme": {
|
||||||
"colors": "رنگهای تم",
|
"colors": "رنگهای تم",
|
||||||
|
|||||||
@@ -5146,7 +5146,8 @@
|
|||||||
"vk": "VK"
|
"vk": "VK"
|
||||||
},
|
},
|
||||||
"backToAccounts": "К списку аккаунтов"
|
"backToAccounts": "К списку аккаунтов"
|
||||||
}
|
},
|
||||||
|
"emailMergePasswordRequired": "Этот email уже привязан к другому аккаунту. Чтобы объединить аккаунты, введите пароль от него."
|
||||||
},
|
},
|
||||||
"theme": {
|
"theme": {
|
||||||
"colors": "Цвета темы",
|
"colors": "Цвета темы",
|
||||||
|
|||||||
@@ -4138,7 +4138,8 @@
|
|||||||
"vk": "VK"
|
"vk": "VK"
|
||||||
},
|
},
|
||||||
"backToAccounts": "返回账户列表"
|
"backToAccounts": "返回账户列表"
|
||||||
}
|
},
|
||||||
|
"emailMergePasswordRequired": "该邮箱已属于另一个账户。要合并账户,请输入该账户的密码。"
|
||||||
},
|
},
|
||||||
"theme": {
|
"theme": {
|
||||||
"colors": "主题颜色",
|
"colors": "主题颜色",
|
||||||
|
|||||||
@@ -409,7 +409,12 @@ export default function ConnectedAccounts() {
|
|||||||
},
|
},
|
||||||
onError: (err: { response?: { data?: { detail?: string } } }) => {
|
onError: (err: { response?: { data?: { detail?: string } } }) => {
|
||||||
const detail = err.response?.data?.detail;
|
const detail = err.response?.data?.detail;
|
||||||
if (detail?.includes('already registered')) {
|
// The email belongs to another account and merging it requires proving
|
||||||
|
// ownership: the backend asks for THAT account's password (account-takeover
|
||||||
|
// fix). Guide the user to enter it rather than showing a dead-end error.
|
||||||
|
if (detail?.includes('merge')) {
|
||||||
|
setEmailError(t('profile.emailMergePasswordRequired'));
|
||||||
|
} else if (detail?.includes('already registered')) {
|
||||||
setEmailError(t('profile.emailAlreadyRegistered'));
|
setEmailError(t('profile.emailAlreadyRegistered'));
|
||||||
} else if (detail?.includes('already have a verified email')) {
|
} else if (detail?.includes('already have a verified email')) {
|
||||||
setEmailError(t('profile.alreadyHaveEmail'));
|
setEmailError(t('profile.alreadyHaveEmail'));
|
||||||
|
|||||||
Reference in New Issue
Block a user