diff --git a/resources/js/routes.js b/resources/js/routes.js index 855d75d6..23e6ef99 100644 --- a/resources/js/routes.js +++ b/resources/js/routes.js @@ -85,6 +85,10 @@ router.beforeEach((to, from, next) => { } else next() } + else if (to.name === 'genericError' && to.params.err == undefined) { + // return to home if no err object is provided to prevent an empty error message + next({ name: 'accounts' }); + } else next() }); diff --git a/resources/js/views/Error.vue b/resources/js/views/Error.vue index 5ee262e9..eb01a43f 100644 --- a/resources/js/views/Error.vue +++ b/resources/js/views/Error.vue @@ -88,14 +88,6 @@ }); }, - - beforeRouteEnter (to, from, next) { - // return to home if no err is provided to prevent an empty error message - if (to.params.err == undefined) { - next({ name: 'accounts' }); - } - else next() - }, }