Skip to content

Commit 3e673a2

Browse files
authored
fix(elements): Ensure missing passwordSettings don't throw (#3474)
1 parent c6cf01c commit 3e673a2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/strong-weeks-destroy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/elements': patch
3+
---
4+
5+
Ensure missing passwordSettings don't throw an error

packages/elements/src/react/hooks/use-password.hook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type UsePasswordCallbacks = {
2020
export const usePassword = (callbacks?: UsePasswordCallbacks) => {
2121
const clerk = useClerk();
2222
const passwordSettings = clerk.__unstable__environment?.userSettings.passwordSettings as PasswordSettingsData;
23-
const { disable_hibp, min_zxcvbn_strength, show_zxcvbn, ...config } = passwordSettings;
23+
const { disable_hibp, min_zxcvbn_strength, show_zxcvbn, ...config } = passwordSettings || {};
2424

2525
const {
2626
onValidationError = noop,

0 commit comments

Comments
 (0)