fix bug: Error on correct password submission (#129)
This commit is contained in:
@@ -32,12 +32,12 @@ const ResetPasswordPage = (props) => {
|
||||
const [bannerErrorMessage, setbannerErrorMessage] = useState('');
|
||||
|
||||
useEffect(() => {
|
||||
if (props.errors) {
|
||||
if (props.status === 'failure' && props.errors) {
|
||||
setbannerErrorMessage(props.errors);
|
||||
setvalidationMessage(props.errors);
|
||||
setPasswordValidValue(false);
|
||||
}
|
||||
}, [props.status === 'failure']);
|
||||
}, [props.status]);
|
||||
|
||||
const validatePasswordFromBackend = async (newPassword) => {
|
||||
let errorMessage;
|
||||
|
||||
@@ -224,6 +224,7 @@ describe('ResetPasswordPage', () => {
|
||||
token_status: 'valid',
|
||||
token: 'token',
|
||||
errors: validationMessage,
|
||||
status: 'failure',
|
||||
};
|
||||
|
||||
const resetPasswordPage = mount(reduxWrapper(<IntlResetPasswordPage {...props} />));
|
||||
|
||||
Reference in New Issue
Block a user