-
Notifications
You must be signed in to change notification settings - Fork 659
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: added username and password validation for various screen (#4650)
* fix: added username and password validation for various screens Signed-off-by: Sahil <sahil.kumar@harness.io> * fix: fixed tests Signed-off-by: Sahil <sahil.kumar@harness.io> --------- Signed-off-by: Sahil <sahil.kumar@harness.io> Co-authored-by: Saranya Jena <saranya.jena@harness.io>
- Loading branch information
1 parent
c4d23a7
commit ae21ffb
Showing
13 changed files
with
78 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import PassowrdInput from './PasswordInput'; | ||
import PasswordInput from './PasswordInput'; | ||
|
||
export default PassowrdInput; | ||
export default PasswordInput; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// ^[a-zA-Z] # Must start with a letter | ||
// [a-zA-Z0-9_-] # Allow letters, digits, underscores, and hyphens | ||
// {2,15}$ # Ensure the length of the username is between 3 and 16 characters (1 character is already matched above) | ||
export const USERNAME_REGEX = /^[a-zA-Z][a-zA-Z0-9_-]{2,15}$/; | ||
|
||
// ^(?=.*[a-z]) # At least one lowercase letter | ||
// (?=.*[A-Z]) # At least one uppercase letter | ||
// (?=.*\d) # At least one digit | ||
// (?=.*[@$!%*?_&]) # At least one special character @$!%*?_& | ||
// [A-Za-z\d@$!%*?_&] # Allowed characters: letters, digits, special characters @$!%*?_& | ||
// {8,16}$ # Length between 8 to 16 characters | ||
export const PASSWORD_REGEX = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?_&])[A-Za-z\d@$!%*?_&]{8,16}$/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters