I want to call the logout function on the close tab or close the browser only, not on the refresh page.
I tried with the below example code it doing logout on the close tab perfectly but also doing logout if I refresh the page.
I want to prevent logout on the refresh page.
window.addEventListener('beforeunload', this.logout)