var urlParams = new URLSearchParams(window.location.search); var redirect = urlParams.get(`redirect`); window.HFMA.endpoints.logout = `${HFMA.login_url}?redirect=${redirect}`; setTimeout(function(){ {{logout()}} },100);