UserPassword

This validates that an input value is equal to the current authenticated
user's password. This is useful in a form where a user can change their
password, but needs to enter their old password for security.

Note

This should not be used to validate a login form, since this is
done automatically by the security system.

Suppose you have a ChangePassword class, that's used in a form where
the user can change their password by entering their old password and a
new password. This constraint will validate that the old password matches
the user's current password: