update token
This commit is contained in:
parent
e026d9bd04
commit
1bc043dd5e
@ -1 +1 @@
|
|||||||
const instance = axios.create({ baseURL: 'http://localhost:8083/api'});
|
const instance = axios.create({ baseURL: 'http://localhost:8083'});
|
@ -6,7 +6,8 @@ document.getElementById("signin").addEventListener("submit", function(evt){
|
|||||||
var pseudo = document.getElementById("floatingPseudo");
|
var pseudo = document.getElementById("floatingPseudo");
|
||||||
var password = document.getElementById("floatingPassword");
|
var password = document.getElementById("floatingPassword");
|
||||||
if((password.value.length > 0) || (pseudo.value.length > 0)){
|
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"; })
|
.then(function(response) { location.href="html/users.html"; })
|
||||||
.catch(function(error){
|
.catch(function(error){
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user