Skip to content
Snippets Groups Projects
Commit d3389b8b authored by Johan Thörnblom's avatar Johan Thörnblom
Browse files

lab 4 part 2 & 5

parent c242b3ad
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -504,10 +504,10 @@ function sign_up() { ...@@ -504,10 +504,10 @@ function sign_up() {
signUpRequest.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); signUpRequest.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
signUpRequest.send(JSON.stringify(user)); signUpRequest.send(JSON.stringify(user));
} }
return false;
} }
function sign_in() { function sign_in() {
console.log("log in pressed");
let form = document.getElementById("sign_in_form"); let form = document.getElementById("sign_in_form");
let email = form[0].value; let email = form[0].value;
let password = form[1].value; let password = form[1].value;
...@@ -517,7 +517,6 @@ function sign_in() { ...@@ -517,7 +517,6 @@ function sign_in() {
if (password.length < minPassLength) if (password.length < minPassLength)
errorMess.innerHTML = "Password's length is too short"; errorMess.innerHTML = "Password's length is too short";
else { else {
// Todo - quickfix
localStorage.setItem("homeEmail", email); localStorage.setItem("homeEmail", email);
// Sending sign_in request to "server" // Sending sign_in request to "server"
...@@ -525,7 +524,6 @@ function sign_in() { ...@@ -525,7 +524,6 @@ function sign_in() {
signInRequest.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); signInRequest.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
signInRequest.send(JSON.stringify({email: email,password: password})); signInRequest.send(JSON.stringify({email: email,password: password}));
} }
return false;
} }
async function sign_out(){ async function sign_out(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment