File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
frontend/src/routes/login Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,13 @@ import { useNavigate } from 'react-router-dom';
9
9
10
10
export const loginFormSchema = z . object ( {
11
11
username : z . string ( ) . min ( 1 , getEmptyFieldErrorMessage ( 'Username' ) ) ,
12
- password : z . string ( ) . min ( 1 , getEmptyFieldErrorMessage ( 'Password' ) ) ,
12
+ password : z
13
+ . string ( )
14
+ . min ( 8 , 'Password must be at least 8 characters' )
15
+ . regex ( / [ A - Z ] / , 'Password must contain at least one uppercase letter' )
16
+ . regex ( / [ a - z ] / , 'Password must contain at least one lowercase letter' )
17
+ . regex ( / [ 0 - 9 ] / , 'Password must contain at least one number' )
18
+ . regex ( / [ ^ A - Z a - z 0 - 9 ] / , 'Password must contain at least one special character' ) ,
13
19
} ) ;
14
20
15
21
type ILoginFormSchema = z . infer < typeof loginFormSchema > ;
You can’t perform that action at this time.
0 commit comments