[1.6.x] Fixed #20675 -- `check_password` should work when no password is specified.

The regression was introduced by 2c4fe761a. refs #20593.

Backport of 8759778185 from master.