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:
parent
0245e3d27c
commit
c14d2d6f26
1 changed files with 2 additions and 4 deletions
|
|
@ -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 });
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue