I know that an answer was given earlier, but I am not satisfied with the answers.
My problem is simple, the user wants to log out.
If it is on the page that is required for login (installed in auth.guard.ts with auth.service.ts) and user logout, I want it to be redirected to the main one.
However , if it is on a secure page, I do not want to redirect it.
I could use AuthGuard, but I don't want to reload the page, so no:
location.reload()
What is my option?
source share