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 4 additions and 3 deletions
Showing only changes of commit 326b21a65c - Show all commits

View File

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

View File

@ -7,8 +7,9 @@ document.getElementById("signin").addEventListener("submit", function(evt){
var password = document.getElementById("floatingPassword");
if((password.value.length > 0) || (pseudo.value.length > 0)){
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"; })
instance.post("token", {username: pseudo.value, password: password.value}, {headers: {'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded' }})
.then(function(response) {
location.href="html/users.html"; })
.catch(function(error){
switch (error.response.status){