Skip to content

Commit

Permalink
fix: weak password error runtime type checks (#819)
Browse files Browse the repository at this point in the history
Made an oops by calling reduce on an object, not an array.
  • Loading branch information
hf authored Dec 7, 2023
1 parent e83c51c commit 016ee66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async function handleError(error: unknown) {
data.weak_password &&
Array.isArray(data.weak_password.reasons) &&
data.weak_password.reasons.length &&
data.weak_password.reduce((a: boolean, i: any) => a && typeof i === 'string', true)
data.weak_password.reasons.reduce((a: boolean, i: any) => a && typeof i === 'string', true)
) {
throw new AuthWeakPasswordError(
_getErrorMessage(data),
Expand Down

0 comments on commit 016ee66

Please sign in to comment.