refactor(auth): accept custom error message in defaultPasswordValidator

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
nxtkofi 2026-04-21 20:53:00 +02:00
parent 0245e3d27c
commit c14d2d6f26

View file

@ -2,8 +2,6 @@ import z from 'zod/v4';
export const supportedLocales = ['en', 'pl']; export const supportedLocales = ['en', 'pl'];
export function defaultPasswordValidator() { export function defaultPasswordValidator(error = 'Hasło jest za krótkie') {
return z return z.string().refine((val) => val.length >= 8, { error });
.string()
.refine((val) => val.length >= 8, { error: 'Hasło jest za krótkie' });
} }