console: handle non access key errors (#356)

[skip ci]
This commit is contained in:
Praveen Durairaj 2018-09-05 18:38:19 +05:30 committed by Shahidh K Muhammed
parent 258885ad4d
commit a49188a606

View File

@ -194,12 +194,16 @@ const dataRouter = (connect, store, composeOnEnterHooks) => {
},
error => {
console.error(JSON.stringify(error));
if (error.code === 'access-denied') {
Promise.all([
store.dispatch({ type: ACCESS_KEY_ERROR, data: true }),
]).then(() => {
replaceState('/login');
cb();
});
} else {
alert(JSON.stringify(error));
}
}
);
}