#31743 (for 2.5.x) Improve wording of failed authentication attempts

Fixed earlier broken stuff. Tested.