We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b407154 commit e40599dCopy full SHA for e40599d
1 file changed
src/script.js
@@ -24,10 +24,13 @@ addEventListener("submit", (event) => {
24
25
console.log(`email submitted: ${email}`);
26
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
- */
+
+ let user = usersTable.find((user) => user.username === email);
+ if (user && user.password === password){
+ renderSuccess();
+ }else{
33
+ renderError();
34
+ }
35
36
});
0 commit comments