mirror of https://github.com/apache/cloudstack.git
auth: wait for auto-discovery before showing view
This partially reverts change from b194ad205b558803b7a1c0c8cc177e5b14e80835 which introduces loading of dashboard while auto-discovery takes place in background. The cons is that user will feel that login is taking time, but he'll be allowed to redirect to a page before session timeout/logout. In #456 a similar usability issue was added. However, a tab refresh will be faster because in b194ad205b558803b7a1c0c8cc177e5b14e80835 we've added support for using cached discovered APIs. Fixes #456 Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
5c066bf96c
commit
fdfa38ac78
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue