Commit 1f8c1a5c by Johannes Schill

fix: Handle state when no password is entered on registration page (#9879)

parent e88bd67d
...@@ -11,15 +11,20 @@ export class PasswordStrength extends React.Component<IProps, any> { ...@@ -11,15 +11,20 @@ export class PasswordStrength extends React.Component<IProps, any> {
} }
render() { render() {
const { password } = this.props;
let strengthText = "strength: strong like a bull."; let strengthText = "strength: strong like a bull.";
let strengthClass = "password-strength-good"; let strengthClass = "password-strength-good";
if (this.props.password.length <= 8) { if (!password) {
return null;
}
if (password.length <= 8) {
strengthText = "strength: you can do better."; strengthText = "strength: you can do better.";
strengthClass = "password-strength-ok"; strengthClass = "password-strength-ok";
} }
if (this.props.password.length < 4) { if (password.length < 4) {
strengthText = "strength: weak sauce."; strengthText = "strength: weak sauce.";
strengthClass = "password-strength-bad"; strengthClass = "password-strength-bad";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment