title: How to Handle Session Timeout in Angular 2 / Java Spring Boot
body: <p>We have an angular 2 application with a java spring boot backend.  In the spring backend, we have set in the YAML config file a session-timeout of 1 hour (for testing purposes, I changed it to 1 minute).  Once the session times out, the token is no long authenticated and the user needs to login again to resume/start the application.</p>
  
  <p>Once the session times out, the angular app should redirect the user to the login page.  It should do this regardless of user activity/idle state.</p>
  
  <p>The thing I am stuck on is how to redirect the user in the angular 2 app to the login page once the session times out.  I am wondering where and how to implement this?  In a service class?  In a user service class (I have a user service class that retrieves logged in user info from the spring backend).  Does every component in the app need to check for session state?</p>
  
  <p>Wondering best practices with angular 2.</p>
  
  <p>Thanks!</p>