Skip to content

Commit 6b59735

Browse files
authored
fix(clerk-js): Fallback to FAPI error message for password pwned case (#2274)
1 parent 12b3629 commit 6b59735

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/rare-bottles-sell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Fallback to the API error message when the password is pwned and there is no translation available.

packages/clerk-js/src/ui/utils/passwordUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const createPasswordError = (errors: ClerkAPIError[], localizationConfig:
3838
const { t, locale, passwordSettings } = localizationConfig;
3939

4040
if (errors?.[0]?.code === 'form_password_size_in_bytes_exceeded' || errors?.[0]?.code === 'form_password_pwned') {
41-
return `${t(localizationKeys(`unstable__errors.${errors?.[0]?.code}` as any))}`;
41+
return `${t(localizationKeys(`unstable__errors.${errors?.[0]?.code}` as any)) || errors?.[0]?.message}`;
4242
}
4343

4444
if (errors?.[0]?.code === 'form_password_not_strong_enough') {

0 commit comments

Comments
 (0)