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 = {
|
||||
...actions,
|
||||
updateUser,
|
||||
redirect(url) {
|
||||
location.href = url;
|
||||
}
|
||||
updateUser
|
||||
};
|
||||
|
||||
export default new AuthFlow(availableActions);
|
||||
|
@ -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`);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user