Hi
I need to remove some items from the local storage when a user disconnects from the frontend.
I tried a code autoaction for all users with the triggers onBeforeLogout or onAfterLogout and the following js but I cannot get it to work
Code:
<script>
const page = window.location.origin;
localStorage.removeItem(page + "_isLoggedIn");
localStorage.removeItem(page + "_token");
localStorage.removeItem(page + "_loginDate");
localStorage.removeItem(page + "_firstname");
localStorage.removeItem(page + "_member");
localStorage.removeItem(page + "_auths");
isLoggedIn = false;
</script>
Does these trigger allow inline js ? Do you have another idea to remove such elements on logout ?
Thanks