Fix dashboard to track server state

This commit is contained in:
Dane Everitt 2018-07-15 17:53:40 -07:00
parent 8b3713e3ff
commit 7f5485d648
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
5 changed files with 95 additions and 31 deletions

View file

@ -46,7 +46,6 @@ const router = new VueRouter({
// have no JWT or the JWT is expired and wouldn't be accepted by the Panel.
router.beforeEach((to, from, next) => {
if (to.path === route('auth.logout')) {
console.log('logging out');
return window.location = route('auth.logout');
}
@ -54,13 +53,11 @@ router.beforeEach((to, from, next) => {
// Check that if we're accessing a non-auth route that a user exists on the page.
if (!to.path.startsWith('/auth') && !(user instanceof User)) {
console.log('logging out 2');
store.commit('auth/logout');
return window.location = route('auth.logout');
}
// Continue on through the pipeline.
console.log('continuing');
return next();
});