How redirect to a page after browser refresh?

271 Views Asked by At

I have an Angular app with 2 main components: login and home. After the user logs in, it's redirected to home component. What I want to do is to redirect back to login page if the browser is refreshed. How could I do this? I know hot to redirect to login page, but I don't know how to do it after browser refresh. I have tried some of this solutions, but with not much success. My project is running using: Angular CLI: 12.2.5, Node: 14.17.6.

0

There are 0 best solutions below