title: Logout on page refresh in Angular 5
body: <p>I want to log out user after refreshing any page in the Angular 5 app. The app contains several components.</p>
  
  <p>I need to handle the refresh event in which I can execute log out functionality and wipe out the logged in user data from the browser. </p>
  
  <p>Also, this refresh event needs to be invoked on page refresh before the execution of the corresponding component of that page
  (on page refresh, the corresponding page's component is also reloaded) as there is user specific functionality in all the component's constructor which will breaking the app on page refresh if I wipe out the user data.</p>
  
  <p>After handling the refresh event prior to the component loading, I need to prevent the further loading of the corresponding page's component and redirect route to login path.</p>