diff --git a/src/api/common.js b/src/api/common.js index 9883ee72..ae810414 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -150,7 +150,7 @@ function handleResponseError (err) { } if (code === 403 && message === 'Password expired') { message = i18n.global.t('Password Expired') - return this.$router.push({ path: PATH_CHANGE_PASSWORD }) + return this.$router?.push({ path: PATH_CHANGE_PASSWORD }) } if (code !== null && message !== null) { diff --git a/src/store/pbx-callqueues.js b/src/store/pbx-callqueues.js index bd3c5170..7fbb7d10 100644 --- a/src/store/pbx-callqueues.js +++ b/src/store/pbx-callqueues.js @@ -256,7 +256,7 @@ export default { }) }, jumpToCallQueue (context, subscriber) { - this.$router.push({ path: '/user/pbx-configuration/call-queues' }) + this.$router?.push({ path: '/user/pbx-configuration/call-queues' }) context.commit('expandCallQueue', subscriber.id) } } diff --git a/src/store/pbx-ms-configs.js b/src/store/pbx-ms-configs.js index 3679306f..b5ebe799 100644 --- a/src/store/pbx-ms-configs.js +++ b/src/store/pbx-ms-configs.js @@ -242,7 +242,7 @@ export default { }) }, jumpToMsConfig (context, subscriber) { - this.$router.push({ path: '/user/pbx-configuration/ms-configs' }) + this.$router?.push({ path: '/user/pbx-configuration/ms-configs' }) context.commit('expandMsConfig', subscriber.id) } } diff --git a/src/store/user.js b/src/store/user.js index 59d49177..f54aaf32 100644 --- a/src/store/user.js +++ b/src/store/user.js @@ -391,7 +391,7 @@ export default { subscriberId: getSubscriberId() }) await context.dispatch('initUser') - await this.$router.push({ name: 'dashboard' }) + await this.$router?.push({ name: 'dashboard' }) } catch (err) { if (err.message === 'Invalid OTP') { if (context.state.loginWaitingOTPCode) { @@ -405,7 +405,7 @@ export default { } context.commit('loginFailed', err.message) if (err.message === 'Password expired') { - this.$router.push({ path: PATH_CHANGE_PASSWORD }) + this.$router?.push({ path: PATH_CHANGE_PASSWORD }) } else if (err.message === 'Banned') { context.commit('loginFailed', i18n.global.t('There is a problem with your account, please contact support')) }