Question regarding guards and redirection

My app requires an authentication. To guard all the pages except the login page, I’ve implemented the angular interface HttpInterceptor concept. Doing so, each http requests to my server are handled, as soon one request is done without being authenticated, the user is redirect to the login page.

https://angular.io/guide/http#intercepting-all-requests-or-responses

Don’t know if this apply to your business case, hope it helps.

P.S.: Furthermore the linked documentation, there are many tutorials, you could google “angular HttpInterceptor”