@@ -21,14 +21,14 @@ const UserChangePassword = ({ password, onChangeInfo }) => {
2121 validationSchema : object ( {
2222 currentPassword : string ( ) . required ( 'please enter your current password' )
2323 . min ( 8 , 'your current password must be 8 characters or more' )
24- . matches ( / ^ (? = .* [ 0 - 9 ] ) (? = .* [ ! @ # $ % ^ & * ] ) [ a - z A - Z 0 - 9 ! @ # $ % ^ & * ] { 6 , 16 } $ / , 'invalid password' ) ,
24+ . matches ( / ^ (? = .* \d ) (? = . * [ a - z ] ) (? = .* [ A - Z ] ) (? = . * [ a - z A - Z ] ) . { 8 , } $ / , 'invalid password' ) ,
2525
2626 newPassword : string ( ) . required ( 'please enter your new password' )
2727 . min ( 8 , 'your new password must be 8 characters or more' )
28- . matches ( / ^ (? = .* [ 0 - 9 ] ) (? = .* [ ! @ # $ % ^ & * ] ) [ a - z A - Z 0 - 9 ! @ # $ % ^ & * ] { 6 , 16 } $ / , 'invalid password' ) ,
28+ . matches ( / ^ (? = .* \d ) (? = . * [ a - z ] ) (? = .* [ A - Z ] ) (? = . * [ a - z A - Z ] ) . { 8 , } $ / , 'invalid password' ) ,
2929
3030 confirmNewPassword : string ( ) . required ( 'please enter your confirm new password' )
31- . matches ( / ^ (? = .* [ 0 - 9 ] ) (? = .* [ ! @ # $ % ^ & * ] ) [ a - z A - Z 0 - 9 ! @ # $ % ^ & * ] { 6 , 16 } $ / , 'invalid password' )
31+ . matches ( / ^ (? = .* \d ) (? = . * [ a - z ] ) (? = .* [ A - Z ] ) (? = . * [ a - z A - Z ] ) . { 8 , } $ / , 'invalid password' )
3232 . oneOf ( [ ref ( 'newPassword' ) ] , 'your confirm new password must match' )
3333 } ) ,
3434 onSubmit : ( values , { setFieldError } ) => {
0 commit comments