- {
- this.state.setPassword ?
- <>
-
- Password
- this.setState({password1: e.target.value})}
- className={(this.state.password1 !== this.state.password2 && this.state.password1.length > 5 && this.state.password2.length > 5)
- ? 'is-invalid'
- : null}
- required
- disabled={this.state.isLoading}
- />
- Password is
- required.
-
-
-
-
- Verify Password
- this.setState({password2: e.target.value})}
- className={(this.state.password1 !== this.state.password2 && this.state.password1.length > 5 && this.state.password2.length > 5)
- ? 'is-invalid'
- : null}
- required
- disabled={this.state.isLoading}
- />
- {
- (this.state.password1 !== '') ?
-
- {
- (this.state.password1 !== this.state.password2)
- ? 'Passwords do not match.'
- : 'Must verify password.'
- }
-
- :
- null
- }
-
- >
- : null
- }
+
+ Password
+ this.setState({password1: e.target.value})}
+ className={
+ (this.state.wasValidated && this.state.password1.length < 6)
+ ? 'is-invalid'
+ : null
+ }
+ required
+ disabled={this.state.isLoading || !this.state.setPassword}
+ minLength="6"
+ maxLength="72"
+ />
+ 5) ? 'd-none' : null}>
+ {
+ (this.state.password1.length)
+ ? 'Password is too short.'
+ : 'Password is required.'
+ }
+
+
+
+
+ Verify Password
+ this.setState({password2: e.target.value})}
+ className={
+ (this.state.wasValidated && this.state.password1 !== this.state.password2 && this.state.password2.length)
+ ? 'is-invalid'
+ : null
+ }
+ required
+ disabled={this.state.isLoading || !this.state.setPassword}
+ minLength="6"
+ />
+ {
+ (this.state.wasValidated && this.state.password1.length && this.state.password2.length)
+ ? Passwords do not match.
+ : null
+ }
+
@@ -205,7 +211,7 @@ class CreateUserModal extends React.Component {