#316: handle promise rejection in forgot password form

This commit is contained in:
SleepWalker 2017-04-13 08:49:02 +03:00
parent 7a30a7e37f
commit 9881199d47

View File

@ -1,3 +1,5 @@
import logger from 'services/logger';
import AbstractState from './AbstractState';
import LoginState from './LoginState';
import CompleteState from './CompleteState';
@ -14,7 +16,10 @@ export default class ForgotPasswordState extends AbstractState {
resolve(context, payload = {}) {
context.run('forgotPassword', {login: payload.email || this.getLogin(context)})
.then(() => context.setState(new RecoverPasswordState()));
.then(() => context.setState(new RecoverPasswordState()))
.catch((err = {}) =>
err.errors || logger.warn('Error requesting password recoverage', err)
);
}
goBack(context) {