You can do it with the ajax
function with the async
property set to false.
$.ajax({
url: "/acme/confirm_authentication",
success: function(data) {
if( data != "confirmed"){
location.href = "logout";
}
},
async:false
});
Hello Friends, I’m Mohit Sharma founder of tutrialwala.com, Full Stack Web Developer. Expertise in WordPress, PHP, Laravel, Angular, and Frontend Development. In this publication, I share everything I know about PHP frameworks and Javascript frameworks, packages, and tools.
Have a project in mind? Get in touch