Fix raising of auth token errors (#5191).
Merge remote-tracking branch 'refs/remotes/drebs/bug/5191_fix-raise-of-auth-token-error' into develop