diff --git a/web/js/config.js b/web/js/config.js index 88833e4..8094a66 100644 --- a/web/js/config.js +++ b/web/js/config.js @@ -1 +1 @@ -const instance = axios.create({ baseURL: 'http://localhost:8083/api'}); \ No newline at end of file +const instance = axios.create({ baseURL: 'http://localhost:8083'}); \ No newline at end of file diff --git a/web/js/login.js b/web/js/login.js index e277061..4f312a5 100644 --- a/web/js/login.js +++ b/web/js/login.js @@ -6,7 +6,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)){ - instance.get("token", { auth : {username: pseudo.value, password: password.value}, withCredentials: true}) + authData = {username: pseudo.value, password: password.value} + instance.post("token", {username: pseudo.value, password: password.value}, {headers: {'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded' }}, { withCredentials: true}) .then(function(response) { location.href="html/users.html"; }) .catch(function(error){