From 854b8250d3bf427707f982410c26c864b4b38291 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Thu, 21 Jul 2022 00:19:46 +0200 Subject: [PATCH] nouvelle page html --- web/html/home.html | 9 +++++++++ web/js/login.js | 8 +++----- 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 web/html/home.html 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"); });