I have an angular application using these two dependencies:
The user can already log in via automatically login
functionality when the app starts and also logout
using a logout button on the welcome page when needed.
I have the problem now that when the user presses the logout button, the app redirects to the login page, but because the login page automatically logs the user in, it jumps back to the welcome page. So you can say the user can never really log out and it is a cycle.
Is there a way that some information about the user, when manually loging out, are stored somewhere constantly? The problem is that when user logs out, the page refreshes and so the components get destroyed and so my component doesn't know if user logged out once or not. I need the information if the user pressed the logout button once and use that in my component to check if the user log out manually, then no automatically login functionality should be used.
Or is that not possible because the page refreshes and so everything, the authService and LocalStorage and everything closes?