Skip to content

chore: Rely on API-based errors for en-US messaging #5809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/soft-snakes-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/localizations': minor
---

Rely on API-based error messaging for `en-US` localizations
4 changes: 2 additions & 2 deletions integration/tests/sign-in-flow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('sign in f
await u.po.signIn.continue();
await u.po.signIn.setPassword('wrong-password');
await u.po.signIn.continue();
await expect(u.page.getByText(/password you entered is incorrect/i)).toBeVisible();
await expect(u.page.getByText(/password is incorrect/i)).toBeVisible();

await u.po.expect.toBeSignedOut();
});
Expand All @@ -142,7 +142,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('sign in f
await u.po.signIn.setPassword('wrong-password');
await u.po.signIn.continue();

await expect(u.page.getByText(/password you entered is incorrect/i)).toBeVisible();
await expect(u.page.getByText(/password is incorrect/i)).toBeVisible();

await u.po.signIn.getUseAnotherMethodLink().click();
await u.po.signIn.getAltMethodsEmailCodeButton().click();
Expand Down
4 changes: 2 additions & 2 deletions integration/tests/sign-in-or-up-flow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSignInOrUpFlow] })('sign-
await u.po.signIn.continue();
await u.po.signIn.setPassword('wrong-password');
await u.po.signIn.continue();
await expect(u.page.getByText(/password you entered is incorrect/i)).toBeVisible();
await expect(u.page.getByText(/password is incorrect/i)).toBeVisible();

await u.po.expect.toBeSignedOut();
});
Expand All @@ -156,7 +156,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSignInOrUpFlow] })('sign-
await u.po.signIn.setPassword('wrong-password');
await u.po.signIn.continue();

await expect(u.page.getByText(/password you entered is incorrect/i)).toBeVisible();
await expect(u.page.getByText(/password is incorrect/i)).toBeVisible();

await u.po.signIn.getUseAnotherMethodLink().click();
await u.po.signIn.getAltMethodsEmailCodeButton().click();
Expand Down
2 changes: 1 addition & 1 deletion integration/tests/sign-in-or-up-restricted-mode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ test.describe('sign-in-or-up restricted mode @nextjs', () => {
await expect(u.page.getByText(/continue to/i)).toBeHidden();
await u.po.signIn.getIdentifierInput().fill(fakeUser.email);
await u.po.signIn.continue();
await expect(u.page.getByText(/We couldn't find an account with those details/i)).toBeVisible();
await expect(u.page.getByText(/Couldn't find your account\./i)).toBeVisible();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ describe('SignUpContinue', () => {
data: [
{
code: 'form_identifier_exists',
long_message: 'some server error',
long_message: 'This username is taken. Please try another.',
message: 'some server error',
meta: { param_name: 'username' },
},
Expand Down
55 changes: 25 additions & 30 deletions packages/localizations/src/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,45 +589,40 @@ export const enUS: LocalizationResource = {
socialButtonsBlockButtonManyInView: '{{provider|titleize}}',
unstable__errors: {
already_a_member_in_organization: '{{email}} is already a member of the organization.',
captcha_invalid:
'Sign up unsuccessful due to failed security validations. Please try using a different browser or disabling browser extensions. If issues persist, contact support for assistance.',
captcha_invalid: undefined,
captcha_unavailable:
'Sign up unsuccessful due to failed bot validation. Please refresh the page to try again or reach out to support for more assistance.',
form_code_incorrect: undefined,
form_identifier_exists__email_address: 'This email address is taken. Please try another.',
form_identifier_exists__phone_number: 'This phone number is taken. Please try another.',
form_identifier_exists__username: 'This username is taken. Please try another.',
form_identifier_not_found: "We couldn't find an account with those details.",
form_param_format_invalid: 'The value entered is in an invalid format. Please check and correct it.',
form_param_format_invalid__email_address: 'Email address must be a valid email address.',
form_param_format_invalid__phone_number: 'Phone number must be in a valid international format.',
form_param_max_length_exceeded__first_name: 'First name should not exceed 256 characters.',
form_param_max_length_exceeded__last_name: 'Last name should not exceed 256 characters.',
form_param_max_length_exceeded__name: 'Name should not exceed 256 characters.',
form_param_nil: 'This field is required and cannot be empty.',
form_param_value_invalid: 'The value entered is invalid. Please correct it.',
form_password_incorrect: 'The password you entered is incorrect. Please try again.',
form_identifier_exists__email_address: undefined,
form_identifier_exists__phone_number: undefined,
form_identifier_exists__username: undefined,
form_identifier_not_found: undefined,
form_param_format_invalid: undefined,
form_param_format_invalid__email_address: undefined,
form_param_format_invalid__phone_number: undefined,
form_param_max_length_exceeded__first_name: undefined,
form_param_max_length_exceeded__last_name: undefined,
form_param_max_length_exceeded__name: undefined,
form_param_nil: undefined,
form_param_value_invalid: undefined,
form_password_incorrect: undefined,
form_password_length_too_short: 'Your password is too short. It must be at least 8 characters long.',
form_password_not_strong_enough: 'Your password is not strong enough.',
form_password_pwned:
'This password has been found as part of a breach and can not be used, please try another password instead.',
form_password_pwned__sign_in:
'This password has been found as part of a breach and can not be used, please reset your password.',
form_password_size_in_bytes_exceeded:
'Your password has exceeded the maximum number of bytes allowed, please shorten it or remove some special characters.',
form_password_validation_failed: 'Incorrect Password',
form_username_invalid_character:
'Your username contains invalid characters. Please use only letters, numbers, and underscores.',
form_password_size_in_bytes_exceeded: undefined,
form_password_validation_failed: undefined,
form_username_invalid_character: undefined,
form_username_invalid_length: 'Your username must be between {{min_length}} and {{max_length}} characters long.',
identification_deletion_failed: 'You cannot delete your last identification.',
identification_deletion_failed: undefined,
not_allowed_access: undefined,
organization_domain_blocked: 'This is a blocked email provider domain. Please use a different one.',
organization_domain_common: 'This is a common email provider domain. Please use a different one.',
organization_domain_exists_for_enterprise_connection: 'This domain is already used for your organization’s SSO',
organization_membership_quota_exceeded:
'You have reached your limit of organization memberships, including outstanding invitations.',
organization_minimum_permissions_needed:
'There has to be at least one organization member with the minimum required permissions.',
organization_domain_blocked: undefined,
organization_domain_common: undefined,
organization_domain_exists_for_enterprise_connection: undefined,
organization_membership_quota_exceeded: undefined,
organization_minimum_permissions_needed: undefined,
passkey_already_exists: 'A passkey is already registered with this device.',
passkey_not_supported: 'Passkeys are not supported on this device.',
passkey_pa_not_supported: 'Registration requires a platform authenticator but the device does not support it.',
Expand All @@ -642,8 +637,8 @@ export const enUS: LocalizationResource = {
requireUppercase: 'an uppercase letter',
sentencePrefix: 'Your password must contain',
},
phone_number_exists: 'This phone number is taken. Please try another.',
session_exists: "You're already signed in.",
phone_number_exists: undefined,
session_exists: undefined,
web3_missing_identifier: 'A Web3 Wallet extension cannot be found. Please install one to continue.',
zxcvbn: {
couldBeStronger: 'Your password works, but could be stronger. Try adding more characters.',
Expand Down