integ-fastapi #1

Merged
v4l3n71n merged 18 commits from integ-fastapi into master 2023-11-03 20:53:29 +00:00
Showing only changes of commit 03ec97003e - Show all commits

View File

@ -9,7 +9,13 @@ document.getElementById("signin").addEventListener("submit", function(evt){
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' }})
.then(function(response) {
location.href="html/users.html"; })
if(response.data["roles"] == "Admin"){
location.href="html/users.html";
}
else {
instance.delete("token")
}
})
.catch(function(error){
switch (error.response.status){