@lancom/shared 0.0.391 → 0.0.392

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ export default function ({ store, redirect }) {
2
+ if (!store.state.auth.token) {
3
+ return redirect('/customer/signin');
4
+ }
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.391",
3
+ "version": "0.0.392",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {
@@ -13,6 +13,7 @@ import metaInfo from '@lancom/shared/mixins/meta-info';
13
13
 
14
14
  export default {
15
15
  name: 'CustomerCouponsPage',
16
+ middleware: 'authenticated',
16
17
  components: {
17
18
  CustomerCoupons: () => import('@lancom/shared/components/customer/customer_coupons/customer-coupons'),
18
19
  CustomerMenu: () => import('@lancom/shared/components/customer/customer_navigation_menu/customer-navigation-menu')
@@ -13,6 +13,7 @@ import metaInfo from '@lancom/shared/mixins/meta-info';
13
13
 
14
14
  export default {
15
15
  name: 'CustomerOrdersPage',
16
+ middleware: 'authenticated',
16
17
  components: {
17
18
  CustomerOrders: () => import('@lancom/shared/components/customer/customer_orders/customer-orders'),
18
19
  CustomerNavigationMenu: () => import('@lancom/shared/components/customer/customer_navigation_menu/customer-navigation-menu')
@@ -12,6 +12,7 @@ import metaInfo from '@lancom/shared/mixins/meta-info';
12
12
 
13
13
  export default {
14
14
  name: 'CustomerCreatePage',
15
+ middleware: 'authenticated',
15
16
  components: {
16
17
  CustomerNavigationMenu: () => import('@lancom/shared/components/customer/customer_navigation_menu/customer-navigation-menu'),
17
18
  CustomerSettings: () => import('@lancom/shared/components/pages/customer/settings/settings')
package/store/auth.js CHANGED
@@ -42,6 +42,7 @@ export const actions = {
42
42
  auth_logout({ commit }) {
43
43
  commit('AUTH_LOGOUT');
44
44
  Cookie.remove('auth');
45
+ window.location.href = '/';
45
46
  },
46
47
  update_user({ commit }, { token, user }) {
47
48
  Cookie.set('auth', token, { expires: 365 });