Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

380
Views
¿Cómo puedo vaciar la tienda Vue cuando me redirigen para iniciar sesión porque la cookie caducó?

La cookie de acceso caduca a los 15 minutos y redirige al usuario al inicio de sesión. Pero ahora tengo que eliminar la cookie y vaciar la tienda como lo hice con la función de cierre de sesión.

Usé js-cookie para manejar cookies.

 //router router.beforeEach((to, from, next) => { const publicPages = ['/login', '/forgot-password', '/recover-password', 'email-forgot-password']; const authRequired = !publicPages.includes(to.path); const loggedIn = AuthService.getAccessToken(); if (authRequired && !loggedIn) { next('/login'); } else { next(); } });
 //store setLogout(state) { state.user = {} state.company = {} state.wallet = null state.intWallet = [] state.extWallet = [] state.extWalletForWithdraw = [] state.transactions = [] state.movements = [] state.token = null state.newTransaction = { fromWallet: null, toWallet: null, amount: 0, } } }, actions: { logout(ctx) { //console.log(ctx) ctx.commit('setLogout') authService.deleteAccessToken() Company().deleteCompanyToken() } }
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!