Hi, when I logout with a user-A and then login with another user (user-B) I still see this user-B data/views. How can I properly clear the cache when the user logout? This is my logout() method written in a service:
Hi Tommertom, thanks.
Do you have some idea on how to do it? I don’t have them set on the component itself as this logout() method is called from a service, like this:
It is there to give a effect of ‘transition’ when displaying the loadingController/modal and dismissing it, otherwise the transition is not smooth, the modal pop up and go away less than a snap.
Maybe my way is not the best, would you suggest me a better one? And better yet, it would be of great if you could help me with the question of this post. Do have any idea? Thanks.
As mentioned above, when I logout from one user and login to another, I still see the former user info and when I try to click on this section it is kind of blocked (like there is something above preventing the click - I have to refresh the DevTools console to make it work properly and update to the correct data to be shown). I’m not sure but I suspect that I must have ruined some routing OR maybe something related to APP_INITIALIZER that I’m using to preload some info before app bootstrap.
I don’t get why my logout() does not clean the previous user data as intended.
Hi
your code is using concepts which are a bit beyond my reach. I am not familiar with APP_INITIALIZER nor with a [@...] syntax as directive in Angular. What does the latter intend to do?
I assume the messagesLoaded variable of the component with this html is actually an variable which gets cleared at the logout through some sort of service (using observables and subscribes)? Although the initial logout code does not show that.
Not sure if the routerLink works on ion-col. I guess it does. Have you tried the (click) handler to see if it does fire on that specific situation?
I’m aware that this is very far from being a “clean” solution. Having found nothing else to delete the data of the services during the disconnection I update the application: