covas-bo/web/js/library.js
2022-07-28 00:15:57 +02:00

16 lines
337 B
JavaScript

function checkToken(){
instance.get("token", { withCredentials: true})
.then(function(response) {
if(location.pathname == "/")
{
location.href="/html/home.html";
}
})
.catch(function(error){
if(location.pathname != "/"){
location.href="/";
}
});
}