You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ha...@apache.org on 2022/11/04 07:12:00 UTC
[cloudstack] branch 2FA updated: Partial changes for UI
This is an automated email from the ASF dual-hosted git repository.
harikrishna pushed a commit to branch 2FA
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/2FA by this push:
new b8d1c99038f Partial changes for UI
b8d1c99038f is described below
commit b8d1c99038f336656c04ca2a22d7f4f117b954d4
Author: Harikrishna Patnala <ha...@gmail.com>
AuthorDate: Fri Nov 4 12:41:45 2022 +0530
Partial changes for UI
---
ui/src/config/router.js | 19 +++++++++----------
ui/src/permission.js | 2 ++
ui/src/views/auth/Login.vue | 1 -
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/ui/src/config/router.js b/ui/src/config/router.js
index e45977c4f64..e720d9ccbe1 100644
--- a/ui/src/config/router.js
+++ b/ui/src/config/router.js
@@ -241,16 +241,6 @@ export function asyncRouterMap () {
generateRouterMap(quota),
generateRouterMap(cloudian),
- {
- path: '/2FA',
- name: 'TwoFa',
- meta: {
- title: 'label.2fa',
- hidden: true
- },
- component: () => import('@/views/dashboard/TwoFa')
- },
-
{
path: '/exception',
name: 'exception',
@@ -317,6 +307,15 @@ export const constantRouterMap = [
}
]
},
+ {
+ path: '/2FA',
+ name: 'TwoFa',
+ meta: {
+ title: 'label.2fa',
+ hidden: true
+ },
+ component: () => import('@/views/dashboard/TwoFa')
+ },
{
path: '/403',
component: () => import(/* webpackChunkName: "forbidden" */ '@/views/exception/403')
diff --git a/ui/src/permission.js b/ui/src/permission.js
index 080a636acfa..b14b826487c 100644
--- a/ui/src/permission.js
+++ b/ui/src/permission.js
@@ -57,9 +57,11 @@ router.beforeEach((to, from, next) => {
const validLogin = vueProps.$localStorage.get(ACCESS_TOKEN) || Cookies.get('userid') || Cookies.get('userid', { path: '/client' })
if (validLogin) {
if (to.path === '/user/login') {
+ console.log('hari3')
next({ path: '/dashboard' })
NProgress.done()
} else {
+ console.log('hari4')
if (Object.keys(store.getters.apis).length === 0) {
const cachedApis = vueProps.$localStorage.get(APIS, {})
if (Object.keys(cachedApis).length > 0) {
diff --git a/ui/src/views/auth/Login.vue b/ui/src/views/auth/Login.vue
index 983ad03cd10..3fd287b7383 100644
--- a/ui/src/views/auth/Login.vue
+++ b/ui/src/views/auth/Login.vue
@@ -301,7 +301,6 @@ export default {
this.$store.commit('SET_LOGIN_FLAG', true)
console.log(store.getters.twoFaEnabled)
if (store.getters.twoFaEnabled === true) {
- console.log('hari1')
this.$router.push({ path: '/2FA' }).catch(() => {})
} else {
console.log('hari2')