From c14d2d6f26c069c49852ae849861146f6cf23d9d Mon Sep 17 00:00:00 2001 From: nxtkofi Date: Tue, 21 Apr 2026 20:53:00 +0200 Subject: [PATCH] refactor(auth): accept custom error message in defaultPasswordValidator Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- src/constants.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index 3d21688..298be8f 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -2,8 +2,6 @@ import z from 'zod/v4'; export const supportedLocales = ['en', 'pl']; -export function defaultPasswordValidator() { - return z - .string() - .refine((val) => val.length >= 8, { error: 'Hasło jest za krótkie' }); +export function defaultPasswordValidator(error = 'Hasło jest za krótkie') { + return z.string().refine((val) => val.length >= 8, { error }); }