An issue was discovered by @Zash where changing the password might fail, but give the user no feedback that it had failed. This could lead to a user thinking their password has been changed, when in fact it has not.
The first commit adds error handling. It's not the best (it throws an XMPP error condition at the user with no explanation), but hopefully we can improve it in the future.
The main reason a password change might fail is because it doesn't meet the policies enforce by the server. For example, if it is too short. The second commit adds some pre-validation before we send it to the server to catch the most common policy violations.
An issue was discovered by @Zash where changing the password might fail, but give the user no feedback that it had failed. This could lead to a user thinking their password has been changed, when in fact it has not.
The first commit adds error handling. It's not the best (it throws an XMPP error condition at the user with no explanation), but hopefully we can improve it in the future.
The main reason a password change might fail is because it doesn't meet the policies enforce by the server. For example, if it is too short. The second commit adds some pre-validation before we send it to the server to catch the most common policy violations.