In my vuejs front-end, a menu is displayed only if the user is logged in. When I log out, the variable isLogged
is updated to false, causing the menu to hide.
If I have multiple tabs open with the frontend (all already logged in) and I logout from one tab, the menu disappears in that tab but remains visible in all other tabs.
I have a function called checkIfIsLogged
which verifies if a token is stored (indicating the user is logged in) and sets the isLogged
variable to false if not. While I can use this function to maintain coherence and update the isLogged
status in all tabs, what would be the best approach? Should it run periodically, only when the user interacts with the tabs, or do you have any other suggestions?