Commit
Β·
0b49790
1
Parent(s):
7a6978d
debug 1
Browse files- 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
|
| 34 |
-
setError('Password must be
|
| 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
|
| 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
|
| 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',
|