ChandimaPrabath commited on
Commit
0b49790
Β·
1 Parent(s): 7a6978d
Files changed (1) hide show
  1. frontend/app/Auth.js +5 -4
frontend/app/Auth.js CHANGED
@@ -30,8 +30,8 @@ const Auth = ({
30
  setError('Username must be at least 4 characters');
31
  return false;
32
  }
33
- if (password.length <= 8) {
34
- setError('Password must be longer than 8 characters');
35
  return false;
36
  }
37
  if (password !== confirmPassword) {
@@ -68,7 +68,7 @@ const Auth = ({
68
 
69
  const checkPassword = (value) => {
70
  setPassword(value);
71
- setPasswordValid(value.length > 8);
72
  };
73
 
74
  const checkPasswordsMatch = (value) => {
@@ -173,7 +173,7 @@ const Auth = ({
173
  {usernameValid ? 'βœ” Username must be at least 4 characters' : '✘ Username must be at least 4 characters'}
174
  </li>
175
  <li style={{ color: passwordValid ? 'green' : 'red' }}>
176
- {passwordValid ? 'βœ” Password must be longer than 8 characters' : '✘ Password must be longer than 8 characters'}
177
  </li>
178
  <li style={{ color: passwordsMatch ? 'green' : 'red' }}>
179
  {passwordsMatch ? 'βœ” Passwords match' : '✘ Passwords do not match'}
@@ -199,6 +199,7 @@ const Auth = ({
199
  );
200
  };
201
 
 
202
  const inputContainerStyle = {
203
  display: 'flex',
204
  flexDirection: 'column',
 
30
  setError('Username must be at least 4 characters');
31
  return false;
32
  }
33
+ if (password.length < 8) { // Password must be at least 8 characters long
34
+ setError('Password must be at least 8 characters');
35
  return false;
36
  }
37
  if (password !== confirmPassword) {
 
68
 
69
  const checkPassword = (value) => {
70
  setPassword(value);
71
+ setPasswordValid(value.length >= 8); // Updated to check for minimum 8 characters
72
  };
73
 
74
  const checkPasswordsMatch = (value) => {
 
173
  {usernameValid ? 'βœ” Username must be at least 4 characters' : '✘ Username must be at least 4 characters'}
174
  </li>
175
  <li style={{ color: passwordValid ? 'green' : 'red' }}>
176
+ {passwordValid ? 'βœ” Password must be at least 8 characters' : '✘ Password must be at least 8 characters'}
177
  </li>
178
  <li style={{ color: passwordsMatch ? 'green' : 'red' }}>
179
  {passwordsMatch ? 'βœ” Passwords match' : '✘ Passwords do not match'}
 
199
  );
200
  };
201
 
202
+ // Styles (as before)
203
  const inputContainerStyle = {
204
  display: 'flex',
205
  flexDirection: 'column',