mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 21:45:43 +01:00
fixed password validation in ui
This commit is contained in:
@@ -11,7 +11,7 @@ type State = {
|
||||
passwordConfirmationFailed: boolean
|
||||
};
|
||||
type Props = {
|
||||
passwordChanged: string => void,
|
||||
passwordChanged: (string, boolean) => void,
|
||||
passwordValidator?: string => boolean,
|
||||
// Context props
|
||||
t: string => string
|
||||
@@ -98,14 +98,12 @@ class PasswordConfirmation extends React.Component<Props, State> {
|
||||
);
|
||||
};
|
||||
|
||||
isValid = () => {
|
||||
return this.state.passwordValid && !this.state.passwordConfirmationFailed
|
||||
};
|
||||
|
||||
propagateChange = () => {
|
||||
if (
|
||||
this.state.password &&
|
||||
this.state.passwordValid &&
|
||||
!this.state.passwordConfirmationFailed
|
||||
) {
|
||||
this.props.passwordChanged(this.state.password);
|
||||
}
|
||||
this.props.passwordChanged(this.state.password, this.isValid());
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user