Merged in feat/LOY-158-signup-with-existing-email-error-handling (pull request #1441)

Feat/LOY-158 signup with existing email error handling

* feat(LOY-158): Add handling for email conflict during signup

- Implement specific error handling for email conflict in signup form
- Add localized error message for existing email accounts across language dictionaries
- Introduce new error type `conflictError` in trpc error handling

* fix(LOY-158): revert translation changes

* fix(LOY-158): Correct Finnish translation for cancellation message


Approved-by: Christian Andolf
This commit is contained in:
Chuma Mcphoy (We Ahead)
2025-02-27 14:30:03 +00:00
parent af7c5853db
commit 8061ab63a8
8 changed files with 27 additions and 2 deletions

View File

@@ -51,6 +51,15 @@ export default function SignupForm({ title }: SignUpFormProps) {
}
},
onError: (error) => {
if (error.data?.code === "CONFLICT") {
toast.error(
intl.formatMessage({
id: "An account with this email already exists. Please try signing in instead.",
})
)
return
}
toast.error(intl.formatMessage({ id: "Something went wrong!" }))
console.error("Component Signup error:", error)
},