diff --git a/web/html/home.html b/web/html/home.html new file mode 100644 index 0000000..585a364 --- /dev/null +++ b/web/html/home.html @@ -0,0 +1,9 @@ + + + + Coucou + + +

Bienvenue

+ + \ No newline at end of file diff --git a/web/js/login.js b/web/js/login.js index 844a338..ffdc46d 100644 --- a/web/js/login.js +++ b/web/js/login.js @@ -1,5 +1,5 @@ instance.get("token", { withCredentials: true}) - .then(function(response) { console.log(response) }) + .then(function(response) { location.href="html/home.html"; }) .catch(function(error){ }); @@ -9,9 +9,8 @@ document.getElementById("signin").addEventListener("submit", function(evt){ var pseudo = document.getElementById("floatingPseudo"); var password = document.getElementById("floatingPassword"); if((password.value.length > 0) || (pseudo.value.length > 0)){ - console.log(pseudo.value); instance.get("token", { auth : {username: pseudo.value, password: password.value}, withCredentials: true}) - .then(function(response) { console.log(response) }) + .then(function(response) { location.href="html/home.html"; }) .catch(function(error){ switch (error.response.status){ @@ -30,8 +29,7 @@ document.getElementById("signin").addEventListener("submit", function(evt){ default: id = "alertUnknown"; break; - } - + } document.getElementById(id).classList.remove("hidden"); });