{"action":"created","issue":{"url":"https://api.github.com/repos/jurassix/react-validation-mixin/issues/18","labels_url":"https://api.github.com/repos/jurassix/react-validation-mixin/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/jurassix/react-validation-mixin/issues/18/comments","events_url":"https://api.github.com/repos/jurassix/react-validation-mixin/issues/18/events","html_url":"https://github.com/jurassix/react-validation-mixin/issues/18","id":78864706,"number":18,"title":"Password confirmation validation","user":{"login":"skiwi2","id":2961606,"avatar_url":"https://avatars.githubusercontent.com/u/2961606?v=3","gravatar_id":"","url":"https://api.github.com/users/skiwi2","html_url":"https://github.com/skiwi2","followers_url":"https://api.github.com/users/skiwi2/followers","following_url":"https://api.github.com/users/skiwi2/following{/other_user}","gists_url":"https://api.github.com/users/skiwi2/gists{/gist_id}","starred_url":"https://api.github.com/users/skiwi2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skiwi2/subscriptions","organizations_url":"https://api.github.com/users/skiwi2/orgs","repos_url":"https://api.github.com/users/skiwi2/repos","events_url":"https://api.github.com/users/skiwi2/events{/privacy}","received_events_url":"https://api.github.com/users/skiwi2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-21T07:04:28Z","updated_at":"2015-05-21T14:54:30Z","closed_at":null,"body":"Currently I'm using the following schema:\r\n\r\n```\r\nvalidatorTypes: function() {\r\n    return {\r\n        username: Joi.string().min(4).max(20).required().label(this.refs.username.props.label),\r\n        email: Joi.string().email().required().label(this.refs.email.props.label),\r\n        password: Joi.string().min(6).max(20).required().label(this.refs.password.props.label),\r\n        confirmPassword: Joi.any().valid(Joi.ref('password')).required().label(this.refs.confirmPassword.props.label)\r\n    };\r\n},\r\n```\r\n\r\nHowever this is leading to situations which might be incorrect, but are definitely unwanted:\r\n\r\n1. When both password and confirmPassword are empty, then ```this.getValidationMessages('confirmPassword')[0]``` is empty.\r\n2. When both password and confirmPassword are matching but have an incorrect length, then ```this.getValidationMessages('confirmPassword')[0]``` is also empty.\r\n\r\nHow can I prevent these situations from occuring?\r\n\r\nI have also opened an issue over at https://github.com/hapijs/joi/issues/652, but it seems to be that the issue is directly related to this library."},"comment":{"url":"https://api.github.com/repos/jurassix/react-validation-mixin/issues/comments/104307740","html_url":"https://github.com/jurassix/react-validation-mixin/issues/18#issuecomment-104307740","issue_url":"https://api.github.com/repos/jurassix/react-validation-mixin/issues/18","id":104307740,"user":{"login":"jurassix","id":1869117,"avatar_url":"https://avatars.githubusercontent.com/u/1869117?v=3","gravatar_id":"","url":"https://api.github.com/users/jurassix","html_url":"https://github.com/jurassix","followers_url":"https://api.github.com/users/jurassix/followers","following_url":"https://api.github.com/users/jurassix/following{/other_user}","gists_url":"https://api.github.com/users/jurassix/gists{/gist_id}","starred_url":"https://api.github.com/users/jurassix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jurassix/subscriptions","organizations_url":"https://api.github.com/users/jurassix/orgs","repos_url":"https://api.github.com/users/jurassix/repos","events_url":"https://api.github.com/users/jurassix/events{/privacy}","received_events_url":"https://api.github.com/users/jurassix/received_events","type":"User","site_admin":false},"created_at":"2015-05-21T14:54:30Z","updated_at":"2015-05-21T14:54:30Z","body":"Can you paste a simple example so i can see your approach?\nOn May 21, 2015 10:52 AM, \"Frank van Heeswijk\" <notifications@github.com>\nwrote:\n\n> @jurassix <https://github.com/jurassix> I have called this.validate()\n> already.\n>\n> There is definitely something wrong with this.getValidationMessages().\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/jurassix/react-validation-mixin/issues/18#issuecomment-104307144>\n> .\n>\n"}}