I need to place a timer inside this sweet alert message but where would I have to place it and how? here I have the option to continue navigating in the location.reload () function; but in the isConfirm that a timer of 30 seconds will appear where the session is automatically closed.
var timeout;
document.onmousemove = function(){
clearTimeout(timeout);
timeout = setTimeout(function(){
swal({
title: "Tu sesión ha expirado",
text: '',
type: "warning",
showCancelButton: true,
cancelButtonText: "Continuar Trabajando",
confirmButtonClass: "btn-danger",
confirmButtonText: "Salir",
closeOnConfirm: false,
showLoaderOnConfirm: true,
},
function(isConfirm){
if (isConfirm) {
$.ajax({
url: base_url + "auth/logout",
type: "POST",
success:function(resp){
window.location.href= base_url;
}
});
}else{
location.reload();
}
});
}, 60000);
}