Fix login issues when token is invalidated