Skip to content

Commit

Permalink
Merge pull request #52 from CSA-Tri-1/homepage
Browse files Browse the repository at this point in the history
quality of life changes for signin
  • Loading branch information
JishnuS420 authored Nov 3, 2023
2 parents a0ea3fd + 4edd170 commit 2a826f3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pages/signin.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,20 @@ <h2>Sign In</h2>
fetch(login_url, authOptions)
.then(response => {
if (response.status === 401) {
alert("Incorrect email or password. Please try again.");
alert("Bad password/username input");
console.log('Authentication failed');
return;
} else if (response.ok) {
// Successfully logged in, now set the email in a cookie
setCookie("email", emailInput.value, 1); // Set the email cookie for an hour
console.log('Successful fetch');
read_pull();
return;
}
else {
const errorMsg = 'Server returned an error: ' + response.status;
console.error(errorMsg);
alert("Uh oh, something went wrong :(");
}
})
.catch(error => {
Expand Down

0 comments on commit 2a826f3

Please sign in to comment.