diff --git a/frontend/app/components/Client/ProfileSettings/ChangePassword.js b/frontend/app/components/Client/ProfileSettings/ChangePassword.js
index d0222abf0..2640ab612 100644
--- a/frontend/app/components/Client/ProfileSettings/ChangePassword.js
+++ b/frontend/app/components/Client/ProfileSettings/ChangePassword.js
@@ -3,6 +3,7 @@ import { connect } from 'react-redux';
import { Button, Message, Form, Input } from 'UI';
import styles from './profileSettings.module.css';
import { updatePassword } from 'Duck/user';
+import { toast } from 'react-toastify';
const ERROR_DOESNT_MATCH = "Passwords doesn't match";
const MIN_LENGTH = 8;
@@ -48,12 +49,15 @@ export default class ChangePassword extends React.PureComponent {
oldPassword,
newPassword,
})
- .then(() => {
- if (this.props.passwordErrors.size === 0) {
- this.setState({
- ...defaultState,
- success: true,
- });
+ .then((e) => {
+ const success = !e || !e.errors || e.errors.length === 0;
+ this.setState({
+ ...defaultState,
+ success: success,
+ show: !success
+ });
+ if (success) {
+ toast.success(`Successfully changed password`);
}
});
};
@@ -98,7 +102,7 @@ export default class ChangePassword extends React.PureComponent {