You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone,
I’ve a problem in my Android app based on Vue2, Capacitor and Quasar.
When I start my app I got this problem:
E/Capacitor/Console: File: https://my-server.com/js/vendor.js - Line 20 - Msg: Uncaught (in promise) Error: Redirected when going from “/” to “/home” via a navigation guard.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi everyone,
I’ve a problem in my Android app based on Vue2, Capacitor and Quasar.
When I start my app I got this problem:
E/Capacitor/Console: File: https://my-server.com/js/vendor.js - Line 20 - Msg: Uncaught (in promise) Error: Redirected when going from “/” to “/home” via a navigation guard.
following my code:
ROUTE.JS
const routes = [
{
},
{
},
{
},
// {
// path: '/renplus',
// name: 'renplus',
// component: () => import('pages/RenPlus.vue'),
// children: [
// { path: '', component: () => import('layouts/MainLayout.vue') }
// ]
// },
]
export default routes
INDEX.JS
import Vue from 'vue'
import VueRouter from 'vue-router'
import store from '../store'
import routes from './routes'
Vue.use(VueRouter)
export default function (/* { store, ssrContext } */) {
const Router = new VueRouter({
scrollBehavior: () => ({ x: 0, y: 0 }),
routes,
mode: 'history',
// Leave these as they are and change in quasar.conf.js instead!
// quasar.conf.js -> build -> vueRouterMode
// quasar.conf.js -> build -> publicPath
mode: process.env.VUE_ROUTER_MODE,
base: process.env.VUE_ROUTER_BASE
})
Router.beforeEach((to, from, next) => {
let jwt = store.state.token;
if (to.matched.some(record => record.meta.requiresAuth)) {
if (jwt == null || jwt == undefined || !jwt) {
if (to.name !== 'Login' && !isAuthenticated) {
next({ name: 'Login' })
}else {
next();
}
} else {
next();
}
} else {
next();
}
return originalPush.call(this, location).catch((err) => {
if (Router.isNavigationFailure(err)) {
// resolve err
return err
}
// rethrow error
return Promise.reject(err)
})
});
return Router
}
it happens only in my android app/android studio debug and not in browser
How can I fix that?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions