diff --git a/ui/src/permission.js b/ui/src/permission.js index 65fcb2be7f8..9fffb7cfda9 100644 --- a/ui/src/permission.js +++ b/ui/src/permission.js @@ -69,7 +69,7 @@ router.beforeEach((to, from, next) => { description: 'Exception caught while discoverying features' }) store.dispatch('Logout').then(() => { - next({ path: '/user/login' }) + next({ path: '/user/login', query: { redirect: to.fullPath } }) }) }) } else { @@ -80,7 +80,7 @@ router.beforeEach((to, from, next) => { if (whiteList.includes(to.name)) { next() } else { - next({ path: '/user/login' }) + next({ path: '/user/login', query: { redirect: to.fullPath } }) NProgress.done() } } diff --git a/ui/src/store/modules/user.js b/ui/src/store/modules/user.js index 6d24e5f6a70..4172eaf96f9 100644 --- a/ui/src/store/modules/user.js +++ b/ui/src/store/modules/user.js @@ -124,15 +124,7 @@ const user = { commit('SET_APIS', cachedApis) resolve(cachedApis) } else { - // This will show the dashboard and some common navigation sections - // to most users/roles, while we complete API autodiscovery - const apis = {} - apis.listUsers = {} - apis.listAccounts = {} - commit('SET_APIS', apis) - resolve(apis) - - const hide = message.loading('Discovering features...', 0) + const hide = message.loading('Discovering features, please wait...', 0) api('listApis').then(response => { const apis = {} const apiList = response.listapisresponse.api @@ -145,6 +137,7 @@ const user = { } } commit('SET_APIS', apis) + resolve(apis) store.dispatch('GenerateRoutes', { apis }).then(() => { router.addRoutes(store.getters.addRouters) })