Skip to content

Commit

Permalink
491: Change pw min length to 8
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-scales committed Apr 13, 2024
1 parent 8de57dd commit ff35d87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions FU.API/FU.API/Services/AccountsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ public async Task<ApplicationUser> Register(Credentials credentials)

// Make sure the password is valid
// Must be 5 characters or longer, and contain at least one special character or number
if (credentials.Password.Length < 5 || !credentials.Password.Any(c => char.IsDigit(c) || char.IsPunctuation(c)))
if (credentials.Password.Length < 8 || !credentials.Password.Any(c => char.IsDigit(c) || char.IsPunctuation(c)))
{
throw new BadRequestException("Password must be at least 5 characters long and contain at least one special character or number");
throw new BadRequestException("Password must be at least 8 characters long and contain at least one special character or number");
}

_dbContext.Users.Add(new ApplicationUser()
Expand Down
4 changes: 2 additions & 2 deletions FU.SPA/src/components/pages/SignUp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function SignUp() {
const isEnabled =
username.length > 0 &&
email.length > 0 &&
password.length >= 5 &&
password.length >= 8 &&
confirmedReadTerms;

// Function called when button is pressed
Expand Down Expand Up @@ -178,7 +178,7 @@ export default function SignUp() {
error={!!passwordError}
helperText={
passwordError ||
'Password must be 5 characters long and contain either 1 special character or number'
'Password must be 8 characters long and contain either 1 special character or number'
}
onChange={handlePasswordChange}
required
Expand Down

0 comments on commit ff35d87

Please sign in to comment.