mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-02-06 00:50:29 +05:30
#122: fix error during redirect
This commit is contained in:
parent
c66c2ac446
commit
c73991c14f
@ -5,10 +5,7 @@ import {updateUser} from 'components/user/actions';
|
|||||||
|
|
||||||
const availableActions = {
|
const availableActions = {
|
||||||
...actions,
|
...actions,
|
||||||
updateUser,
|
updateUser
|
||||||
redirect(url) {
|
|
||||||
location.href = url;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default new AuthFlow(availableActions);
|
export default new AuthFlow(availableActions);
|
||||||
|
@ -53,6 +53,11 @@ export default class AuthFlow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
run(actionId, payload) {
|
run(actionId, payload) {
|
||||||
|
if (actionId === 'redirect') {
|
||||||
|
location.href = payload;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.actions[actionId]) {
|
if (!this.actions[actionId]) {
|
||||||
throw new Error(`Action ${actionId} does not exists`);
|
throw new Error(`Action ${actionId} does not exists`);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user