From faf449953b280afa4ec8e77e3daec7cf89014acb Mon Sep 17 00:00:00 2001
From: Hugo Zigha <hugo.zigha@al-enterprise.com>
Date: Mon, 29 Jul 2024 11:35:07 +0200
Subject: [PATCH] MT#60578 Navigates to /dashboard on refresh

Change-Id: I10ff7d9b7354cd7385e40a20337c9e21d1c6c769
---
 src/App.vue                   | 1 -
 src/boot/routes.js            | 2 --
 src/layouts/CscLayoutMain.vue | 4 ----
 src/router/routes.js          | 2 +-
 src/store/user.js             | 9 ---------
 5 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/src/App.vue b/src/App.vue
index e7e2dd8c..ffe1261e 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -26,7 +26,6 @@ export default {
     async mounted () {
         this.$initWait()
         this.updateTitle(this.$route)
-        await this.$router.push({ name: 'dashboard' })
     },
     methods: {
         updateTitle: function (route) {
diff --git a/src/boot/routes.js b/src/boot/routes.js
index 0165ef6f..944afd5d 100644
--- a/src/boot/routes.js
+++ b/src/boot/routes.js
@@ -54,7 +54,5 @@ export default ({ app, router, store }) => {
             subscriberId: getSubscriberId()
         })
     }
-
-    store.$router = router
     Dark.set(true)
 }
diff --git a/src/layouts/CscLayoutMain.vue b/src/layouts/CscLayoutMain.vue
index 82cfe5d0..b16458f3 100644
--- a/src/layouts/CscLayoutMain.vue
+++ b/src/layouts/CscLayoutMain.vue
@@ -536,9 +536,6 @@ export default {
                 })
             }
             window.scrollTo(0, 0)
-            if (route.path === '/user/dashboard') {
-                this.forwardHome()
-            }
         }
     },
     async mounted () {
@@ -553,7 +550,6 @@ export default {
     },
     methods: {
         ...mapActions('user', [
-            'forwardHome',
             'fetchAuthToken'
         ]),
         ...mapActions('call', [
diff --git a/src/router/routes.js b/src/router/routes.js
index 313f2bf2..6249f307 100644
--- a/src/router/routes.js
+++ b/src/router/routes.js
@@ -560,7 +560,7 @@ const routes = [
     {
         path: '/',
         redirect: {
-            name: 'root'
+            name: 'dashboard'
         }
     },
     {
diff --git a/src/store/user.js b/src/store/user.js
index c254ce74..48aab8bb 100644
--- a/src/store/user.js
+++ b/src/store/user.js
@@ -362,13 +362,10 @@ export default {
                             console.log(err)
                         }
                     }
-                    await context.dispatch('forwardHome')
                 } catch (err) {
                     console.debug(err)
                     await context.dispatch('logout')
                 }
-            } else {
-                await context.dispatch('forwardHome')
             }
         },
         async changePassword (context, newPassword) {
@@ -400,12 +397,6 @@ export default {
                 commit('userPasswordFailed', err.message)
             }
         },
-        async forwardHome (context) {
-            const start = '/user/dashboard'
-            if (context.rootState.route?.path !== start) {
-                await this.$router.push({ name: 'root' })
-            }
-        },
         async getCustomLogo (context) {
             if (!context.state.logo) {
                 context.commit('updateLogoRequestState', true)