check if the token is valid, if not redirect to login and show a warning