]> git.codecow.com Git - libnemo.git/commitdiff
Replace unsafe password check result with loggable feedback.
authorChris Duncan <chris@codecow.com>
Tue, 4 Aug 2026 23:13:45 +0000 (16:13 -0700)
committerChris Duncan <chris@codecow.com>
Tue, 4 Aug 2026 23:13:45 +0000 (16:13 -0700)
src/lib/wallet/index.ts

index bc0bb80d8bd883eb2096c4ee5aed85c76968f986..6db838ec288071641b0ef7e3310597d11f23eed4 100644 (file)
@@ -48,9 +48,9 @@ export class Wallet {
                if (typeof password !== 'string') {\r
                        throw new TypeError('Password must be a string')\r
                }\r
-               const passwordCheck = this.#zxcvbn.check(password)\r
-               if (passwordCheck.score < 4) {\r
-                       throw new RangeError('Weak password', { cause: passwordCheck })\r
+               const { feedback, score } = this.#zxcvbn.check(password)\r
+               if (score < 4) {\r
+                       throw new RangeError('Weak password', { cause: feedback })\r
                }\r
        }\r
 \r