Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
<body>
<form>
<!-- TODO: Fix Logo Rendering Issue-->
<img src="/logo.png" />
<img src="./logo.svg" />
<span id="success-message" hidden="true">Success!</span>
<span id="error-message" hidden="true">Invalid Credentials</span>
<label for="email">Email</label>
<label for="email" >Email</label>
<!-- TODO: Add HTML Email Validation to Email Input -->
<input id="email" type="text" placeholder="Enter your email" />
<input id="email" type="email" placeholder="Enter your email" />
<label for="password">Password</label>
<!-- TODO: Update HTML Password Input to Hide Password Visibility -->
<input id="password" type="text" placeholder="Enter your password" />
<input id="password" type="password" placeholder="Enter your password"/>
<button>Submit</button>
</form>
</body>
Expand Down
13 changes: 13 additions & 0 deletions src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,17 @@ addEventListener("submit", (event) => {
2. If they are, call renderSuccess()
3. If they are not, call renderError()
*/
var userFound = false;
usersTable.forEach((user) => {
if(user.username === email && user.password == password) {
userFound = true;
}
});

if(userFound){
renderSuccess();
} else {
renderError();
}

});
1 change: 1 addition & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ body {
display: flex;
/* TODO: Adjust CSS so that form is centered on page */
align-items: center;
justify-content: center;
}

form {
Expand Down