From 04a01b02ddddfc054d2e6d0e1b07f89b7dba8d4f Mon Sep 17 00:00:00 2001 From: Marcin Kwiatkowski Date: Thu, 3 Feb 2022 09:30:21 +0100 Subject: [PATCH] chore: release 1.0.0-rc.5.4 (#19) --- plugins/token-expired.js | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 plugins/token-expired.js diff --git a/plugins/token-expired.js b/plugins/token-expired.js deleted file mode 100644 index d3c8773..0000000 --- a/plugins/token-expired.js +++ /dev/null @@ -1,27 +0,0 @@ -import cookieNames from '~/enums/cookieNameEnum'; - -export default ({ app, redirect }) => { - let once = true; - - - app.$vsf.$magento.client.interceptors.response.use(async (r) => { - - if (r.data.message === 'The current customer isn\'t authorized.' && once) { - once = false; - app.$cookies.remove(cookieNames.customerCookieName); - app.$cookies.remove(cookieNames.cartCookieName); - - await app.$cookies.set(cookieNames.messageCookieName, { - message: app.i18n.t('You are not authorized, please log in.'), - type: 'warning', - icon: null, - persist: true, - title: null, - }); - - redirect(app.localePath('/')); - } - - return r; - }); -};