/****************************************************************************************************/ /* ATS - Association Technology Solutions */ /* This may not be copied, used, or redistributed without the expressed written consent of ATS */ /* info@atsol.org - www.atsol.org */ /* Copyright 2023 */ /****************************************************************************************************/ /****************************************************************************************************/ /* ATS Settings */ /****************************************************************************************************/ /* Do not edit anything below this line */ /* ------------------------------------------------------------------ */ var requestToken = jQuery("#__RequestVerificationToken").val(); console.log('Token: ' + requestToken); var logoutPath = '/AsiCommon/Controls/Shared/FormsAuthentication/logout.aspx'; console.log('Log out path: ' + logoutPath); /* Set the url to return to */ const urlParams2 = new URLSearchParams(window.location.search); console.log('URL param: ' + urlParams2); // Retrieve the "returl" parameter const returl = urlParams2.get('returl'); console.log('returl: ' + urlParams2); //var decodedURL = returl.replace(/&/g,'&'); //console.log('decodedURL: ' + decodedURL); /* Set the logout url */ var logoutUrl = gWebRoot + logoutPath; console.log("Log out url: " + logoutUrl); jQuery.ajax({ method: "post", url: logoutUrl, headers: { "RequestVerificationToken": requestToken }, success: function(result) { window.location = returl;}, error: function(jqXHR, textStatus, errorThrown) { { console.log("Failure"); if (true) { { console.log('Error: ' + errorThrown); // Error returned console.log(textStatus); // Request Status in plain text console.log(jqXHR.status); // HTTP Status Code } } } } })