Skip to content

Commit

Permalink
fix: require 10 char min passwrd
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Oct 11, 2023
1 parent b7cbb03 commit 4e6923b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions public/admin_api/update-password.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ function __construct(
$new_password_hash = hash('sha256', $new_password);

if(
strlen($new_password) < 8 ||
strlen($new_password) < 10 ||
!preg_match('/[\'\/~`\!@#\$%\^&\*\(\)_\-\+=\{\}\[\]\|;:"\<\>,\.\?\\\]/', $new_password) ||
!preg_match('/[0-9]/', $new_password)
) {
_exit(
'error',
'Password must be at least 8 characters long, contain at least one (1) number, and one (1) special character',
'Password must be at least 10 characters long, contain at least one (1) number, and one (1) special character',
400,
'Invalid password. Does not meet complexity requirements'
);
Expand Down
4 changes: 2 additions & 2 deletions public/user_api/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ function __construct(
}

if (
strlen($password) < 8 ||
strlen($password) < 10 ||
!preg_match('/[\'\/~`\!@#\$%\^&\*\(\)_\-\+=\{\}\[\]\|;:"\<\>,\.\?\\\]/', $password) ||
!preg_match('/[0-9]/', $password)
) {
_exit(
'error',
'Password must be at least 8 characters long, contain at least one (1) number, and one (1) special character',
'Password must be at least 10 characters long, contain at least one (1) number, and one (1) special character',
400,
'Invalid password. Does not meet complexity requirements'
);
Expand Down
4 changes: 2 additions & 2 deletions public/user_api/set-password.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ function __construct(

if (
!$new_password ||
strlen($new_password) < 8 ||
strlen($new_password) < 10 ||
!preg_match('/[\'\/~`\!@#\$%\^&\*\(\)_\-\+=\{\}\[\]\|;:"\<\>,\.\?\\\]/', $new_password) ||
!preg_match('/[0-9]/', $new_password)
) {
_exit(
'error',
'Invalid new password. Must be at least 8 characters long, contain at least one (1) special character, and one (1) number',
'Invalid new password. Must be at least 10 characters long, contain at least one (1) special character, and one (1) number',
400,
'Invalid new password. Failed complexity requirements'
);
Expand Down
4 changes: 2 additions & 2 deletions public/user_api/update-password.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ function __construct(
$new_password_hash = hash('sha256', $new_password);

if(
strlen($new_password) < 8 ||
strlen($new_password) < 10 ||
!preg_match('/[\'\/~`\!@#\$%\^&\*\(\)_\-\+=\{\}\[\]\|;:"\<\>,\.\?\\\]/', $new_password) ||
!preg_match('/[0-9]/', $new_password)
) {
_exit(
'error',
'Password must be at least 8 characters long, contain at least one (1) number, and one (1) special character',
'Password must be at least 10 characters long, contain at least one (1) number, and one (1) special character',
400,
'Invalid password. Does not meet complexity requirements'
);
Expand Down

0 comments on commit 4e6923b

Please sign in to comment.