Skip to content

Commit 8b3713e

Browse files
committed
FOrmat and disable server store temporarily
1 parent d0348a4 commit 8b3713e

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

resources/assets/scripts/router.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import VueRouter from 'vue-router';
22
import store from './store/index';
3-
import compareDate from 'date-fns/compare_asc'
4-
import addHours from 'date-fns/add_hours'
5-
import dateParse from 'date-fns/parse'
3+
64
const route = require('./../../../vendor/tightenco/ziggy/src/js/route').default;
75

86
// Base Vuejs Templates
@@ -13,22 +11,22 @@ import ResetPassword from './components/auth/ResetPassword';
1311
import User from './models/user';
1412

1513
const routes = [
16-
{ name: 'login', path: '/auth/login', component: Login },
17-
{ name: 'forgot-password', path: '/auth/password', component: Login },
18-
{ name: 'checkpoint', path: '/auth/checkpoint', component: Login },
14+
{name: 'login', path: '/auth/login', component: Login},
15+
{name: 'forgot-password', path: '/auth/password', component: Login},
16+
{name: 'checkpoint', path: '/auth/checkpoint', component: Login},
1917
{
2018
name: 'reset-password',
2119
path: '/auth/password/reset/:token',
2220
component: ResetPassword,
2321
props: function (route) {
24-
return { token: route.params.token, email: route.query.email || '' };
22+
return {token: route.params.token, email: route.query.email || ''};
2523
}
2624
},
2725

28-
{ name : 'dashboard', path: '/', component: Dashboard },
29-
{ name : 'account', path: '/account', component: Account },
30-
{ name : 'account.api', path: '/account/api', component: Account },
31-
{ name : 'account.security', path: '/account/security', component: Account },
26+
{name: 'dashboard', path: '/', component: Dashboard},
27+
{name: 'account', path: '/account', component: Account},
28+
{name: 'account.api', path: '/account/api', component: Account},
29+
{name: 'account.security', path: '/account/security', component: Account},
3230

3331
{
3432
name: 'server',
@@ -48,18 +46,21 @@ const router = new VueRouter({
4846
// have no JWT or the JWT is expired and wouldn't be accepted by the Panel.
4947
router.beforeEach((to, from, next) => {
5048
if (to.path === route('auth.logout')) {
49+
console.log('logging out');
5150
return window.location = route('auth.logout');
5251
}
5352

5453
const user = store.getters['auth/getUser'];
5554

5655
// Check that if we're accessing a non-auth route that a user exists on the page.
5756
if (!to.path.startsWith('/auth') && !(user instanceof User)) {
57+
console.log('logging out 2');
5858
store.commit('auth/logout');
5959
return window.location = route('auth.logout');
6060
}
6161

6262
// Continue on through the pipeline.
63+
console.log('continuing');
6364
return next();
6465
});
6566

resources/assets/scripts/store/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ Vue.use(Vuex);
77

88
const store = new Vuex.Store({
99
strict: process.env.NODE_ENV !== 'production',
10-
modules: { auth, server },
10+
modules: { auth },
1111
});
1212

1313
if (module.hot) {
1414
module.hot.accept(['./modules/auth'], () => {
1515
const newAuthModule = require('./modules/auth').default;
16-
const newServerModule = require('./modules/server').default;
16+
// const newServerModule = require('./modules/server').default;
1717

1818
store.hotUpdate({
19-
modules: { newAuthModule, newServerModule },
19+
modules: { newAuthModule },
2020
});
2121
});
2222
}

0 commit comments

Comments
 (0)