integ-fastapi #3

Merged
v4l3n71n merged 18 commits from agenda/backoffice:integ-fastapi into master 2023-11-03 20:42:59 +00:00
2 changed files with 3 additions and 2 deletions
Showing only changes of commit 1bc043dd5e - Show all commits

View File

@ -1 +1 @@
const instance = axios.create({ baseURL: 'http://localhost:8083/api'});
const instance = axios.create({ baseURL: 'http://localhost:8083'});

View File

@ -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){