fix(ui) - create account recaptcha reset on error
This commit is contained in:
parent
2e75927ff1
commit
c920d9c902
1 changed files with 13 additions and 0 deletions
|
|
@ -26,11 +26,24 @@ export default class SignupForm extends React.Component {
|
|||
email: '',
|
||||
projectName: '',
|
||||
organizationName: '',
|
||||
reload: false,
|
||||
};
|
||||
|
||||
static getDerivedStateFromProps(props, state) {
|
||||
if (props.errors && props.errors.size > 0 && state.reload) {
|
||||
recaptchaRef.current.reset();
|
||||
return {
|
||||
reload: false
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
handleSubmit = (token) => {
|
||||
const { tenantId, fullname, password, email, projectName, organizationName, auth } = this.state;
|
||||
this.props.signup({ tenantId, fullname, password, email, projectName, organizationName, auth, 'g-recaptcha-response': token })
|
||||
this.setState({ reload: true })
|
||||
}
|
||||
|
||||
write = ({ target: { value, name } }) => this.setState({ [ name ]: value })
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue