diff --git a/.changeset/rare-bottles-sell.md b/.changeset/rare-bottles-sell.md new file mode 100644 index 00000000000..3631ebead7a --- /dev/null +++ b/.changeset/rare-bottles-sell.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-js': patch +--- + +Fallback to the API error message when the password is pwned and there is no translation available. diff --git a/packages/clerk-js/src/ui/utils/passwordUtils.ts b/packages/clerk-js/src/ui/utils/passwordUtils.ts index 34c3d765c95..b05ef79688a 100644 --- a/packages/clerk-js/src/ui/utils/passwordUtils.ts +++ b/packages/clerk-js/src/ui/utils/passwordUtils.ts @@ -38,7 +38,7 @@ export const createPasswordError = (errors: ClerkAPIError[], localizationConfig: const { t, locale, passwordSettings } = localizationConfig; if (errors?.[0]?.code === 'form_password_size_in_bytes_exceeded' || errors?.[0]?.code === 'form_password_pwned') { - return `${t(localizationKeys(`unstable__errors.${errors?.[0]?.code}` as any))}`; + return `${t(localizationKeys(`unstable__errors.${errors?.[0]?.code}` as any)) || errors?.[0]?.message}`; } if (errors?.[0]?.code === 'form_password_not_strong_enough') {