Currently, I am encountering an issue where there are two separate dashboards for different types of users - one for admin and the other for a merchant. The problem arises when an admin logs in on one tab and then a merchant logs in on another tab in the same browser. Upon refreshing the admin page, I notice that the navbar meant for the merchant appears, while the rest of the page remains as the admin's dashboard content. This situation may be related to how I handle storing tokens in the localStorage.
I am seeking advice on how to properly log out the previously logged-in user if a new user logs in on the same browser session. Any suggestions or solutions would be greatly appreciated.