diff --git a/src/services/authFlow/AbstractState.js b/src/services/authFlow/AbstractState.js index da78cae..9e00887 100644 --- a/src/services/authFlow/AbstractState.js +++ b/src/services/authFlow/AbstractState.js @@ -3,11 +3,11 @@ import type { AuthContext } from 'services/authFlow'; export default class AbstractState { - resolve(context: AuthContext, payload: Object): void {} - goBack(context: AuthContext): void { + resolve(context: AuthContext, payload: Object): * {} + goBack(context: AuthContext): * { throw new Error('There is no way back'); } - reject(context: AuthContext, payload: Object): void {} - enter(context: AuthContext): void {} - leave(context: AuthContext): void {} + reject(context: AuthContext, payload: Object): * {} + enter(context: AuthContext): * {} + leave(context: AuthContext): * {} } diff --git a/src/services/authFlow/AuthFlow.test.js b/src/services/authFlow/AuthFlow.test.js index 741a504..3927717 100644 --- a/src/services/authFlow/AuthFlow.test.js +++ b/src/services/authFlow/AuthFlow.test.js @@ -206,7 +206,7 @@ describe('AuthFlow', () => { const expected = 'dispatch called'; store.dispatch.returns(expected); - expect(flow.run('test'), 'to be fulfilled with', expected); + return expect(flow.run('test'), 'to be fulfilled with', expected); }); it('throws when running unexisted action', () => { diff --git a/src/services/authFlow/MfaState.js b/src/services/authFlow/MfaState.js index 2746fab..226da57 100644 --- a/src/services/authFlow/MfaState.js +++ b/src/services/authFlow/MfaState.js @@ -31,7 +31,7 @@ export default class MfaState extends AbstractState { rememberMe } = getCredentials(context.getState()); - context.run('login', { + return context.run('login', { totp, password, rememberMe, diff --git a/src/services/authFlow/PasswordState.js b/src/services/authFlow/PasswordState.js index cf56626..b04f2e1 100644 --- a/src/services/authFlow/PasswordState.js +++ b/src/services/authFlow/PasswordState.js @@ -33,7 +33,7 @@ export default class PasswordState extends AbstractState { ) { const {login} = getCredentials(context.getState()); - context.run('login', { + return context.run('login', { password, rememberMe, login