mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-01-15 16:22:07 +05:30
#316: handle promise rejection in forgot password form
This commit is contained in:
parent
7a30a7e37f
commit
9881199d47
@ -1,3 +1,5 @@
|
|||||||
|
import logger from 'services/logger';
|
||||||
|
|
||||||
import AbstractState from './AbstractState';
|
import AbstractState from './AbstractState';
|
||||||
import LoginState from './LoginState';
|
import LoginState from './LoginState';
|
||||||
import CompleteState from './CompleteState';
|
import CompleteState from './CompleteState';
|
||||||
@ -14,7 +16,10 @@ export default class ForgotPasswordState extends AbstractState {
|
|||||||
|
|
||||||
resolve(context, payload = {}) {
|
resolve(context, payload = {}) {
|
||||||
context.run('forgotPassword', {login: payload.email || this.getLogin(context)})
|
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) {
|
goBack(context) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user