feat: add password validation

This commit is contained in:
ahmadzuhdi 2019-01-31 11:31:57 +07:00
parent e178fe8410
commit 67bbcba5e2

View File

@ -130,6 +130,11 @@ class RegisterPage extends React.Component {
register = () => { register = () => {
// return this.props.history.push(LINKS.LOGIN);
if (this.state.password.length < 8) {
return message.warning("password need atleast 8 characters");
}
// if (this.state.upload_photo === '') { // if (this.state.upload_photo === '') {
// return message.warning("please upload photo"); // return message.warning("please upload photo");
// } // }
@ -158,10 +163,7 @@ class RegisterPage extends React.Component {
additional_data: {} additional_data: {}
}; };
this.authStore.register(data).then(res => { this.authStore.register(data).then(res => {
// message.success("Please check your email to confirm your account"); //message.success("Please check your email to confirm your account");this.props.history.push(LINKS.LOGIN);
setTimeout(() => { setTimeout(() => {
this.setState({ isLoading: false }); this.setState({ isLoading: false });
this.props.history.push(LINKS.REGISTER_COMPLETED); this.props.history.push(LINKS.REGISTER_COMPLETED);