Handles the login status in the routes