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`); }