Skip to content

Commit

Permalink
1.9.2: Improve password regex to accept OWASP characters
Browse files Browse the repository at this point in the history
* Passwd regex check now accepts all special chars

* Set internal password validation regex to same as registration

* Version bump

---------

Co-authored-by: Jack Bailey <81699395+JackBailey@users.noreply.github.com>
  • Loading branch information
James-Stokes and JackBailey authored May 14, 2024
1 parent 91cef43 commit 149e2ec
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [1.9.2] - 2024-05-14

- Improve password regex to accept OWASP characters

## [1.9.1] - 2024-03-26

- Remove vite-plugin-rewrite-all
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.1
1.9.2
2 changes: 1 addition & 1 deletion frontend/src/components/Dash/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
name="password"
label="Password"
help="At least 1 lowercase, 1 uppercase, 1 number and 1 special character. Minimum of 12 characters"
:validation="[['required'], ['matches', /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&._-])[A-Za-z\d@$!%*?&._-]{12,}$/]]"
:validation="[['required'], ['matches', /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*\W)(?!.* ).{12,}$/]]"
:validation-messages="{
matches: 'Password does not match requirements.',
}"
Expand Down
2 changes: 1 addition & 1 deletion src/db/modules/valid/password.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = (password) => /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&._-])[A-Za-z\d@$!%*?&._-]{12,}$/.test(password);
module.exports = (password) => /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*\W)(?!.* ).{12,}$/.test(password);

0 comments on commit 149e2ec

Please sign in to comment.