From c73991c14fb1ce3e29f6c1faf605850814894f77 Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Mon, 30 May 2016 07:23:27 +0300 Subject: [PATCH] #122: fix error during redirect --- src/services/authFlow.js | 5 +---- src/services/authFlow/AuthFlow.js | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/services/authFlow.js b/src/services/authFlow.js index f23d115..1252413 100644 --- a/src/services/authFlow.js +++ b/src/services/authFlow.js @@ -5,10 +5,7 @@ import {updateUser} from 'components/user/actions'; const availableActions = { ...actions, - updateUser, - redirect(url) { - location.href = url; - } + updateUser }; export default new AuthFlow(availableActions); diff --git a/src/services/authFlow/AuthFlow.js b/src/services/authFlow/AuthFlow.js index bc09c1e..a766630 100644 --- a/src/services/authFlow/AuthFlow.js +++ b/src/services/authFlow/AuthFlow.js @@ -53,6 +53,11 @@ export default class AuthFlow { } run(actionId, payload) { + if (actionId === 'redirect') { + location.href = payload; + return; + } + if (!this.actions[actionId]) { throw new Error(`Action ${actionId} does not exists`); }