Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
somebody1234 committed Aug 17, 2023
1 parent ee5891f commit 853858a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export default function ResetPassword() {
name="new_password"
placeholder="New Password"
pattern={validation.PASSWORD_PATTERN}
title={validation.PASSWORD_ERROR}
error={validation.PASSWORD_ERROR}
value={newPassword}
setValue={setNewPassword}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
/** @file Validation patterns for text inputs. */

/** Regex pattern for valid AWS Cognito passwords. */
/** Regex pattern for valid AWS Cognito passwords.
* A fully correct regex is here: https://stackoverflow.com/a/58767981/3323231.
* Official documentation is here: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-policies.html.
* However, non-ASCII passwords are allowed, contrary to the official documentation. Further
* investigation may be needed.
*
* Each of the four lookaheads in the regex below check for, respectively:
* - a digit
* - a Basic Latin uppercase character
* - a Basic Latin lowercase character, and
* - an ASCII symbol.
*/
export const PASSWORD_PATTERN =
'(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[ ^$*.\\[\\]\\{\\}\\(\\)?"!@#%&\\/,><\':;\\|_~`=+\\-]).{6,256}'
/** Human readable explanation of password requirements. */
Expand Down

0 comments on commit 853858a

Please sign in to comment.