From 016ee66b3183c3bb00c9e954dbf4226319756f76 Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Thu, 7 Dec 2023 11:34:52 +0100 Subject: [PATCH] fix: weak password error runtime type checks (#819) Made an oops by calling reduce on an object, not an array. --- src/lib/fetch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/fetch.ts b/src/lib/fetch.ts index 359179d0f..7a63d1834 100644 --- a/src/lib/fetch.ts +++ b/src/lib/fetch.ts @@ -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),