Skip to content

Commit

Permalink
chore: refactor to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
btasker committed Jan 4, 2024
1 parent 6d15bf6 commit 0b39f83
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/onboarding/containers/LoginPageContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,13 @@ class LoginPageContents extends PureComponent<Props> {
const emailError = email === '' ? 'Email is required' : ''
const pwlen = new Blob([password]).size

if (pwlen > 72){
const passwordError = 'Password is longer than 72 bytes'
} else {
const passwordError = password === '' ? 'Password is required' : ''
}
const passwordError = password === '' ? 'Password is required' : ''
const passwordLenError = pwlen > 72 ? 'Password is longer than 72 bytes' : ''

const errors: ErrorObject = {
emailError,
passwordError,
passwordLenError,
}

const isValid = Object.values(errors).every(error => error === '')
Expand Down

0 comments on commit 0b39f83

Please sign in to comment.