Fix raising of auth token errors (#5191).