Skip to content

Commit

Permalink
Add Special Character support for password
Browse files Browse the repository at this point in the history
  • Loading branch information
Debajyoti14 committed May 14, 2024
1 parent be37426 commit d5e3eb4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
File renamed without changes.
6 changes: 6 additions & 0 deletions src/utils/validation_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ impl Validation {
return false;
}

// Check for at least one special character
let has_special = password.chars().any(|c| c.is_ascii_punctuation());
if !has_special {
return false;
}

// No whitespace allowed
if password.contains(' ') {
return false;
Expand Down

0 comments on commit d5e3eb4

Please sign in to comment.