We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 231e707 commit 03b10d1Copy full SHA for 03b10d1
app/utils/user-validation.ts
@@ -16,9 +16,11 @@ export const UsernameSchema = z
16
export const PasswordSchema = z
17
.string({ required_error: 'Password is required' })
18
.min(6, { message: 'Password is too short' })
19
- // NOTE: bcrypt has a limit of 72 characters (which should be plenty long)
+ // NOTE: bcrypt has a limit of 72 bytes (which should be plenty long)
20
// https://github.com/epicweb-dev/epic-stack/issues/918
21
- .max(72, { message: 'Password is too long' })
+ .refine((val) => new TextEncoder().encode(val).length <= 72, {
22
+ message: 'Password is too long',
23
+ })
24
25
export const NameSchema = z
26
.string({ required_error: 'Name is required' })
0 commit comments