Hey everyone, I'm facing a minor issue with my Angular 5 project. I am trying to use a common session check method from a shared TypeScript file. This method is used both when the page loads and when the logout button is clicked to redirect the user to the login page. Strangely, it works fine when the page first loads but throws an error of 'undefined' when the button is clicked. Any help would be greatly appreciated. Thank you!
Dashboard https://i.sstatic.net/wvq1Q.jpg Imported https://i.sstatic.net/92kpK.png