Skip to content

Commit e40599d

Browse files
committed
correccion issue script
1 parent b407154 commit e40599d

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

src/script.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ addEventListener("submit", (event) => {
2424

2525
console.log(`email submitted: ${email}`);
2626
console.log(`password submitted: ${password}`);
27-
/*
28-
TODO:
29-
1. Check if the email and password are valid (using the usersTable)
30-
2. If they are, call renderSuccess()
31-
3. If they are not, call renderError()
32-
*/
27+
28+
let user = usersTable.find((user) => user.username === email);
29+
30+
if (user && user.password === password){
31+
renderSuccess();
32+
}else{
33+
renderError();
34+
}
35+
3336
});

0 commit comments

Comments
 (0)